Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 35B61989B4E for ; Wed, 11 Jan 2012 12:17:11 -0400 (AST) Received: from outboundmail.zionsbancorp.com ([209.20.103.195]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Rl0rK-0005xH-Na for pgsql-bugs@postgresql.org; Wed, 11 Jan 2012 16:17:11 +0000 Received: from pps.filterd (utppmail01 [127.0.0.1]) by utppmail01.cs.zionsbank.com (8.14.4/8.14.4) with SMTP id q0BGDQeS027958; Wed, 11 Jan 2012 09:16:52 -0700 Received: from utexht02.zbc.internal ([10.233.229.39]) by utppmail01.cs.zionsbank.com with ESMTP id 129dfn039f-3 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Wed, 11 Jan 2012 09:16:52 -0700 Received: from utexvs02.zbc.internal ([fe80::1936:8793:35ae:676d]) by UTEXHT02.zbc.internal ([::1]) with mapi; Wed, 11 Jan 2012 09:16:52 -0700 From: John Udick To: Tom Lane , "Kevin.Grittner@wicourts.gov" CC: "pgsql-bugs@postgresql.org" Date: Wed, 11 Jan 2012 09:16:51 -0700 Subject: Re: BUG #6391: insert does not insert correct value Thread-Topic: [BUGS] BUG #6391: insert does not insert correct value Thread-Index: AczQdLqZ2SBe1DtzTiK/qU2CItgESAAAD5Sw Message-ID: References: <19647.1326295274@sss.pgh.pa.us> In-Reply-To: <19647.1326295274@sss.pgh.pa.us> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.5.7110, 1.0.211, 0.0.0000 definitions=2012-01-11_03:2012-01-11, 2012-01-11, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=1 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1012030000 definitions=main-1201110136 Content-Type: text/plain; charset="ISO-8859-1" X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201201/87 X-Sequence-Number: 32154 Following the example provided, this still appears to be a bug. The results= are very different when we run the example. We did notice that although no= w() failed, changing this to 'now()'::date works (using single quotes aroun= d now()). I will be working with our administrators to review patches and v= ersion levels.=20 Also, apparently we are not truly a Postgres database, but EMC's Greenplum = database. I will be working with our admins and EMC, unless someone in Post= gres can point out a specific version that resolved this issue.=20 drop table if exists t; create table t=20 (id int primary key,=20 d1 date not null,=20 d2 date not null); =20=20=20 insert into t values (1, now(), current_date), (2, localtimestamp::date, date_in(date_out(current_date))), (3, 'now()'::date, clock_timestamp()::DATE); select * from t order by 1; id | d1 | d2=20=20=20=20=20 ----+------------+------------ 1 | 1999-12-31 | 1999-12-31 2 | 1999-12-31 | 1999-12-31 3 | 2012-01-11 | 2012-01-11 Additional information - select version(); "PostgreSQL 8.2.15 (Greenplum Database 4.1.1.5 build 1) on x86_64-unknown-l= inux-gnu, compiled by GCC gcc (GCC) 4.4.2 compiled on Sep 20 2011 11:09:08" John Udick | Enterprise Data Warehouse Development -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us]=20 Sent: Wednesday, January 11, 2012 8:21 AM To: John Udick Cc: pgsql-bugs@postgresql.org Subject: Re: [BUGS] BUG #6391: insert does not insert correct value=20 john.udick@zionsbancorp.com writes: > I would expect that at the time/date of the of now() and clock_timestamp() > to be equal; which they are. Well, they are not in general, but that doesn't appear to be your problem. You have not shown us a reproducible test case, but I wonder whether your table has a trigger that is doing date_trunc('year',...) or something like that on the column value. regards, tom lane =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D THIS ELECTRONIC MESSAGE, INCLUDING ANY ACCOMPANYING DOCUMENTS, IS CONFIDENT= IAL and may contain information that is privileged and exempt from disclosu= re under applicable law. If you are neither the intended recipient nor resp= onsible for delivering the message to the intended recipient, please note t= hat any dissemination, distribution, copying or the taking of any action in= reliance upon the message is strictly prohibited. If you have received thi= s communication in error, please notify the sender immediately. Thank you.