pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: john.udick@zionsbancorp.com
To: pgsql-bugs@postgresql.org
Subject: BUG #6391: insert does not insert correct value
Date: Tue, 10 Jan 2012 22:52:58 +0000
Message-ID: <E1RkkYs-0004gn-TS@wrigleys.postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      6391
Logged by:          John
Email address:      john.udick@zionsbancorp.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.




view thread (6+ messages)  latest in thread

Message-ID: <E1RkkYs-0004gn-TS@wrigleys.postgresql.org>
Permalink:  ../E1RkkYs-0004gn-TS@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/E1RkkYs-0004gn-TS@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: john.udick@zionsbancorp.com
  Subject: Re: BUG #6391: insert does not insert correct value
  In-Reply-To: <E1RkkYs-0004gn-TS@wrigleys.postgresql.org>
  References: <E1RkkYs-0004gn-TS@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox