Skip site navigation (1) Skip section navigation (2)

Re: replacing a function called "isnull" reports an error

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: César Arnold <cesararnold(at)yahoo(dot)com(dot)br>,pgsql-bugs(at)postgresql(dot)org
Subject: Re: replacing a function called "isnull" reports an error
Date: 2004-08-24 19:59:12
Message-ID: 7061.1093377552@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Csar 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

In response to

Responses

pgsql-bugs by date

Next:From: Alvaro HerreraDate: 2004-08-24 20:06:37
Subject: Re: server crash in very big transaction [postgresql 8.0beta1]
Previous:From: Tom LaneDate: 2004-08-24 19:51:18
Subject: Re: vm/swap used until exhausted

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group