Unix Technical Forum

plpythonu and return void

This is a discussion on plpythonu and return void within the Pgsql General forums, part of the PostgreSQL category; --> I recently migrated a database from Postgres 7.4.1 to Postgres 8.03. The only problem I have run into is ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 05:21 AM
Adrian Klaver
 
Posts: n/a
Default plpythonu and return void

I recently migrated a database from Postgres 7.4.1 to Postgres 8.03. The only
problem I have run into is that a plpythonu function that returns void will
not run under 8.03. The error message states that a plpython function cannot
return void. I got around it by having it return text and not actually
returning anything. I have searched for an explanation and can't seem to
locate one. Obviously I have missed something I just don't know what? Any
suggestions would be appreciated.
--
Adrian Klaver
aklaver@comcast.net

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 05:21 AM
Tom Lane
 
Posts: n/a
Default Re: plpythonu and return void

Adrian Klaver <aklaver@comcast.net> writes:
> I recently migrated a database from Postgres 7.4.1 to Postgres 8.03. The only
> problem I have run into is that a plpythonu function that returns void will
> not run under 8.03. The error message states that a plpython function cannot
> return void. I got around it by having it return text and not actually
> returning anything. I have searched for an explanation and can't seem to
> locate one.


The explanation is doubtless here:

2004-09-19 19:38 tgl

* src/pl/plpython/plpython.c: Add defenses against plpython
functions being declared to take or return pseudotypes. Not sure
why I neglected to add these checks at the same time I added them
to the other PLs, but it seems I did.

It's certainly possible to weaken this test to allow "void" again,
but shouldn't there be corresponding changes elsewhere to ensure that
the behavior is actually sensible?

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-09-2008, 05:23 AM
Adrian Klaver
 
Posts: n/a
Default Re: plpythonu and return void

On Monday 08 August 2005 08:02 pm, Tom Lane wrote:
> Adrian Klaver <aklaver@comcast.net> writes:
> > I recently migrated a database from Postgres 7.4.1 to Postgres 8.03. The
> > only problem I have run into is that a plpythonu function that returns
> > void will not run under 8.03. The error message states that a plpython
> > function cannot return void. I got around it by having it return text and
> > not actually returning anything. I have searched for an explanation and
> > can't seem to locate one.

>
> The explanation is doubtless here:
>
> 2004-09-19 19:38 tgl
>
> * src/pl/plpython/plpython.c: Add defenses against plpython
> functions being declared to take or return pseudotypes. Not sure
> why I neglected to add these checks at the same time I added them
> to the other PLs, but it seems I did.
>
> It's certainly possible to weaken this test to allow "void" again,
> but shouldn't there be corresponding changes elsewhere to ensure that
> the behavior is actually sensible?
>
> regards, tom lane

Thanks for the explanation. One of these days I will remember that the source
is my friend.
--
Adrian Klaver
aklaver@comcast.net

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:33 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com