Search Postgresql Archives

SELECT 'NOW()' - OK, SELECT 'CLOCK_TIMESTAMP()' - ERROR

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

 



Hello,

I found strange PostgreSQL 9.3 behavior:

> select now()::timestamp, 'now()'::timestamp;
            now             |         timestamp          
----------------------------+----------------------------
 2014-08-22 08:34:00.883268 | 2014-08-22 08:34:00.883268

Second column is now() in single apostrophes.

Now, I tried similar function, clock_timestamp() and get:

> select clock_timestamp()::timestamp, 'clock_timestamp()'::timestamp;
ERROR:  invalid input syntax for type timestamp: "clock_timestamp()"
LINE 1: select clock_timestamp()::timestamp, 'clock_timestamp()'::ti...
                                               ^

Why is NOW() so special? Where is it documented? And why not working with other timestamp returning internal functions?

> select version();
                                                               version                                                                
--------------------------------------------------------------------------------------------------------------------------------------
 PostgreSQL 9.3.4 on amd64-portbld-freebsd10.0, compiled by FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610, 64-bit
(1 wiersz)


--
Piotr Gasidło

[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