Re: date and time - Mailing list pgsql-general

From Raymond O'Donnell
Subject Re: date and time
Date
Msg-id 47E7C146.5070107@iol.ie
Whole thread Raw
In response to Re: date and time  ("Alain Roger" <raf.news@gmail.com>)
List pgsql-general
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@iol.ie
---------------------------------------------------------------

pgsql-general by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: date and time
Next
From: Edoardo Panfili
Date:
Subject: Re: C function and enum types parameters