dbTalk Databases Forums  

[BUGS] BUG #2788: Create Function operator Broken?

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #2788: Create Function operator Broken? in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Shawn Tayler
 
Posts: n/a

Default [BUGS] BUG #2788: Create Function operator Broken? - 11-27-2006 , 08:24 PM







The following bug has been logged online:

Bug reference: 2788
Logged by: Shawn Tayler
Email address: stayler (AT) washoecounty (DOT) us
PostgreSQL version: 8.1.5
Operating system: Linux 2.6.17
Description: Create Function operator Broken?
Details:

I have been through the online DOC's the FAQ and can find nothing wrong with
it. So I am thinking its a bug.

CREATE FUNCTION default_status() returns null AS
'BEGIN
update status set wc to false, np to false, elk to false, sp1 to false,
sp2 to false, wc_rep to false, np_rep to false, elk_rep to false, sp1_rep to
false,
sp2_rep to false;
END;'
language 'sql';

It throughs a syntax error at the 'AS' and I can't seem to figure out why.

Sorry if this is not a real bug.

Shawn

---------------------------(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

Reply With Quote
  #2  
Old   
Stephan Szabo
 
Posts: n/a

Default Re: [BUGS] BUG #2788: Create Function operator Broken? - 11-27-2006 , 11:09 PM






On Mon, 27 Nov 2006, Shawn Tayler wrote:

Quote:
The following bug has been logged online:

Bug reference: 2788
Logged by: Shawn Tayler
Email address: stayler (AT) washoecounty (DOT) us
PostgreSQL version: 8.1.5
Operating system: Linux 2.6.17
Description: Create Function operator Broken?
Details:

I have been through the online DOC's the FAQ and can find nothing wrong with
it. So I am thinking its a bug.

CREATE FUNCTION default_status() returns null AS
Do you mean returns void? I believe the issue is that returns null starts
the "returns null on null input" function attribute.

Quote:
'BEGIN
update status set wc to false, np to false, elk to false, sp1 to false,
sp2 to false, wc_rep to false, np_rep to false, elk_rep to false, sp1_rep to
false,
sp2_rep to false;
END;'
language 'sql';
The above body isn't valid for an sql body as well.
Sql functions won't have a begin or end, and I don't think those "to"s
will be valid either.

---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate


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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.