Re: [GENERAL] Question on timestamp in psql - Mailing list pgsql-general

From Bruce Momjian
Subject Re: [GENERAL] Question on timestamp in psql
Date
Msg-id 200001111628.LAA10481@candle.pha.pa.us
Whole thread Raw
In response to Question on timestamp in psql  (Robert Rothe <rrothe@mindspring.com>)
List pgsql-general
> When I type the following at the psql prompt:
>
> select timestamp('now');
>
> ...I always get december 31, 1999.
>
> If I use 'now' as the rvalue to a SET, or within an INSERT, it returns
> the correct date.
>
> Is this a known problem?  I'm running 6.5.2-1.

Yikes, confirmed in current sources:

    test=> select timestamp('now');
           timestamp
    ------------------------
     1999-12-31 19:00:00-05
    (1 row)

This works:

    test=> select timestamp('now'::timestamp);
           timestamp
    ------------------------
     2000-01-11 11:28:08-05
    (1 row)

--
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-general by date:

Previous
From: Robert Rothe
Date:
Subject: Question on timestamp in psql
Next
From: admin
Date:
Subject: Re: [GENERAL] Re: can't seem to use index