Search Postgresql Archives

Re: Regarding niladic functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@xxxxxxxxxxxxxx

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux