Date = current_timestamp inconsistency?

From: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Date = current_timestamp inconsistency?
Date: 2003-04-18 07:03:34
Message-ID: 3E9FA346.6030607@mega-bucks.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I've observed the following seeming inconsistency in postgres:

select ('2003-04-18'=current_timestamp::date) --> True
select ('2003-04-18'::date=current_timestamp::date) --> True
select (d=current_timestamp) from t --> False
select (d=current_timestamp::date) from t --> False
select (d::date=current_timestamp::date) from t --> False

TEST=# select ('2003-04-18'=current_timestamp::date);
?column?
----------
t
(1 row)

TEST=# select ('2003-04-18'::date=current_timestamp::date);
?column?
----------
t
(1 row)

TEST=# create table t(d date);
CREATE TABLE
TEST=# insert into t values('2003-04-08');
INSERT 4475385 1
TEST=# select * from t;
d
------------
2003-04-08
(1 row)

TEST=# select (d=current_timestamp) from t;
?column?
----------
f
(1 row)

TEST=# select (d=current_timestamp::date) from t;
?column?
----------
f
(1 row)

TEST=# select (d::date=current_timestamp::date) from t;
?column?
----------
f
(1 row)

Jean-Christian Imbeault

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Network Administrator 2003-04-18 07:42:27 Re: 7.3 PDF documentation
Previous Message Jean-Christian Imbeault 2003-04-18 03:57:47 General vs Novice