Re: Regarding niladic functions

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: Regarding niladic functions
Дата
Msg-id 42521391.8010601@samurai.com
обсуждение исходный текст
Ответ на Regarding niladic functions  ("Chandra Sekhar Surapaneni" <chandu@positivenetworks.net>)
Ответы Re: Regarding niladic functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Chandra Sekhar Surapaneni wrote:
>    Can we write our own niladic functions in 8.0.0? I want to write a
> niladic function similar to current_timestamp, but I did not find any
> information in the documentation.

If you mean a function without any arguments, it is trivial:

CREATE FUNCTION foo() RETURNS ... AS ...;
SELECT foo();

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.

-Neil

В списке pgsql-general по дате отправления:

Предыдущее
От: Michael Fuhr
Дата:
Сообщение: Re: How to dump data from database?
Следующее
От: go
Дата:
Сообщение: Re: How to dump data from database?