dbTalk Databases Forums  

[BUGS] replacing a function called "isnull" reports an error

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


Discuss [BUGS] replacing a function called "isnull" reports an error in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
César Arnold
 
Posts: n/a

Default [BUGS] replacing a function called "isnull" reports an error - 08-24-2004 , 02:05 PM






Hi, I created a function called "isnull" for test
purposes and when trying to replace it returns the
message belows :

-- Function: public.isnull(anyelement)

-- DROP FUNCTION public.isnull(anyelement);

CREATE OR REPLACE FUNCTION public.isnull(anyelement)
RETURNS bool AS
'
SELECT $1 is null;
'
LANGUAGE 'sql' VOLATILE;

ERROR: syntax error at or near "isnull" at character
120

Thanks.






__________________________________________________ _____
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade!
http://br.acesso.yahoo.com/

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

http://www.postgresql.org/docs/faqs/FAQ.html

Reply With Quote
  #2  
Old   
Peter Eisentraut
 
Posts: n/a

Default Re: [BUGS] replacing a function called "isnull" reports an error - 08-24-2004 , 02:26 PM






César Arnold wrote:
Quote:
Hi, I created a function called "isnull" for test
purposes and when trying to replace it returns the
message belows :
ISNULL is a reserved word. You need to quote the name or pick a
different one.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
  #3  
Old   
Tom Lane
 
Posts: n/a

Default Re: [BUGS] replacing a function called "isnull" reports an error - 08-24-2004 , 03:00 PM



Peter Eisentraut <peter_e (AT) gmx (DOT) net> writes:
Quote:
César Arnold wrote:
Hi, I created a function called "isnull" for test
purposes and when trying to replace it returns the
message belows :

ISNULL is a reserved word. You need to quote the name or pick a
different one.
I think what he's unhappy about is this inconsistency:

regression=# create function isnull(int) returns bool as 'select $1 is null' language sql;
CREATE FUNCTION
regression=# drop function isnull(int);
DROP FUNCTION
regression=# create function public.isnull(int) returns bool as 'select $1 is null' language sql;
ERROR: syntax error at or near "isnull" at character 24
LINE 1: create function public.isnull(int) returns bool as 'select $...
^
regression=#

ISNULL is a func_name_keyword, so it's legal standing on its own, but we
only allow ColId in a qualified name. Possibly that could be relaxed.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
  #4  
Old   
César Arnold
 
Posts: n/a

Default Re: [BUGS] replacing a function called "isnull" reports an error - 08-27-2004 , 06:16 PM



Thanks Tom,
I'm trying to drop the function and it's giving a
similar message that the function cannot be dropped
....

I have supposed that "isnull" was a reserved word, but
the system could not accept to create a function if
it cannot drop it (I guess).
Thanks again.

--- Tom Lane <tgl (AT) sss (DOT) pgh.pa.us> escreveu:
Quote:
Peter Eisentraut <peter_e (AT) gmx (DOT) net> writes:
César Arnold wrote:
Hi, I created a function called "isnull" for test
purposes and when trying to replace it returns
the
message belows :

ISNULL is a reserved word. You need to quote the
name or pick a
different one.

I think what he's unhappy about is this
inconsistency:

regression=# create function isnull(int) returns
bool as 'select $1 is null' language sql;
CREATE FUNCTION
regression=# drop function isnull(int);
DROP FUNCTION
regression=# create function public.isnull(int)
returns bool as 'select $1 is null' language sql;
ERROR: syntax error at or near "isnull" at
character 24
LINE 1: create function public.isnull(int) returns
bool as 'select $...
^
regression=#

ISNULL is a func_name_keyword, so it's legal
standing on its own, but we
only allow ColId in a qualified name. Possibly that
could be relaxed.

regards, tom lane





__________________________________________________ _____
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade!
http://br.acesso.yahoo.com/

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly


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.