Re: Regarding niladic functions - Mailing list pgsql-general

From Tom Lane
Subject Re: Regarding niladic functions
Date
Msg-id 9754.1112679153@sss.pgh.pa.us
Whole thread Raw
In response to Re: Regarding niladic functions  (Neil Conway <neilc@samurai.com>)
Responses Re: Regarding niladic functions (another form)  (Pavel Stehule <stehule@kix.fsv.cvut.cz>)
List pgsql-general
Neil Conway <neilc@samurai.com> writes:
> If you mean a function that doesn't take any arguments and can be
> invoked without an empty set of parentheses (like current_timestamp),
> there isn't a way to define such a function via SQL. You could probably
> hack the SQL parser to add support for specific functions like this, as
> is done for current_timestamp and friends.

It would in fact *require* a parser change, which is why we don't
support it.

(Personally I think it was tremendously stupid of the SQL committee
to define these things as keywords rather than functions, anyway ...
as is, they conflict with column names, which they would not do if
they were invoked as foo() ...)

            regards, tom lane

pgsql-general by date:

Previous
From: go
Date:
Subject: Re: How to dump data from database?
Next
From: Pavel Stehule
Date:
Subject: Re: Regarding niladic functions (another form)