Re: date and time

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Alain Roger <raf(dot)news(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: date and time
Date: 2008-03-24 14:57:10
Message-ID: 47E7C146.5070107@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)iol(dot)ie
---------------------------------------------------------------

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Edoardo Panfili 2008-03-24 15:01:24 Re: C function and enum types parameters
Previous Message Thomas Kellerer 2008-03-24 14:56:44 Re: date and time