Re: date and time - Mailing list pgsql-general

From Alain Roger
Subject Re: date and time
Date
Msg-id 75645bbb0803240745l43023c17g9668a3cf09219f2c@mail.gmail.com
Whole thread Raw
In response to Re: date and time  (Raymond O'Donnell <rod@iol.ie>)
Responses Re: date and time  (Thomas Kellerer <spam_eater@gmx.net>)
Re: date and time  (Raymond O'Donnell <rod@iol.ie>)
List pgsql-general
Hi Ray,

yes for sure. Here it is:
SELECT count(*) INTO existing_email FROM cust_portal.tmp_newsletterreg;
    if (existing_email <>0) then
    {
        result = false;
    }
    else
    {
        result = true;
        INSERT INTO cust_portal.tmp_newsletterreg VALUES
        (
            nextval( 'tmp_newsletterreg_nlreg_id_seq' ),
            email,
            session,
            SELECT CURRENT_TIMESTAMP;
        )
    }
    end if;

    RETURN(result);

On Mon, Mar 24, 2008 at 3:42 PM, Raymond O'Donnell <rod@iol.ie> wrote:
On 24/03/2008 14:35, Alain Roger wrote:
> for that i use "select * from now();" and store the result into a column
> table.
>
> is there a easier way to do that ? i tried to store directly now();
> result but without success.

Can you show us the full SQL statement?

You could also use CURRENT_TIMESTAMP - look at the following:

http://www.postgresql.org/docs/8.3/static/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT

HTH,

Ray.


---------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
---------------------------------------------------------------



--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008

pgsql-general by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: date and time
Next
From: Adrian Klaver
Date:
Subject: Re: date and time