IIRC, current_timestamp doesn't require parens. You could try something
like this:
select extract(epoch from current_timestamp)::int4 as result;
-Mark
On Mon, 2008-06-09 at 12:05 -0400, Michael Eshom wrote:
> I am a project manager for a popular forum system. We are adding
> support for PostgreS
On Mon, Jun 09, 2008 at 12:05:52PM -0400, Michael Eshom wrote:
> I am trying to create a "UNIX_TIMESTAMP()" function in PostgreSQL, which
> will return the current timestamp. However, whenever I try to add this
> function in phpPgAdmin, it says 'Syntax error at or near ")" at
> character 28'.
y
Hello
current_timestamp is some more than less constant :)
try, please
postgres=# select extract(epoch from current_timestamp);
date_part
--
1213030028.17068
(1 row)
or
postgres=# select extract(epoch from current_timestamp)::int;
date_part
1213030113
(1 row)
I am a project manager for a popular forum system. We are adding support
for PostgreSQL in the next version (which is currently in beta), and
have added several PostgreSQL functions to emulate MySQL functions of
the same name.
I am trying to create a "UNIX_TIMESTAMP()" function in PostgreSQL,