Search Postgresql Archives

Re: date and time

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

 



On 24/03/2008 14:45, Alain Roger wrote:
INSERT INTO cust_portal.tmp_newsletterreg VALUES
(
  nextval( 'tmp_newsletterreg_nlreg_id_seq' ),
  email,
  session,
  SELECT CURRENT_TIMESTAMP;
> )

Hi Alain,

That won't work; you just need

  ... values (.... email, session, CURRENT_TIMESTAMP)

CURRENT_TIMESTAMP is a function, so it's return value will be used where it appears.

What procedural language are you using? If it's pl/pgsql then the curly brackets aren't needed, nor are the parentheses in the return statement. Also, there's a semi-colon missing after the INSERT statement, which may or may not cause problems.

Ray.

---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@xxxxxx
---------------------------------------------------------------

-
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[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