BUG #6391: insert does not insert correct value

From: john(dot)udick(at)zionsbancorp(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #6391: insert does not insert correct value
Date: 2012-01-10 22:52:58
Message-ID: E1RkkYs-0004gn-TS@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 6391
Logged by: John
Email address: john(dot)udick(at)zionsbancorp(dot)com
PostgreSQL version: 8.4.1
Operating system: CentOS
Description:

I would expect that at the time/date of the of now() and clock_timestamp()
to be equal; which they are. However for the insert this is not true.

select localtimestamp::date, now()::date, clock_timestamp()::date

"2012-01-10";"2012-01-10";"2012-01-10"

multiple row insert:
insert into v002235.array_stg values (1, date_trunc('hours',now()),
current_date, array['101','113'], 'Y')
, (2, localtimestamp::date, current_date
, array['101','113'], 'Y')
, (3, now(), clock_timestamp()::DATE,
array['101','113'], 'Y')

Results
1;"1999-12-31";"1999-12-31";"{101,113}";"Y"
2;"1999-12-31";"1999-12-31";"{101,113}";"Y"
3;"1999-12-31";"2012-01-10";"{101,113}";"Y"

Why is this not the case? I would expect that my records should all have the
same value, not some arbitrary date from the past.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message vic 2012-01-11 00:24:35 BUG #6392: leak memory while restore/load dump
Previous Message Tom Lane 2012-01-10 16:16:17 Re: BUG #6390: maximum data limit of Postgres.