David Fetter <da...@fetter.org> writes:
>     CREATE TABLE bar(t TIMESTAMP WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP);

> This is a foot gun we need not have.

Yes, we do need to have it.

(1) if we remove the implicit cast from timestamptz to timestamp, the
villagers will be on our doorsteps with the usual equipment.  I'm still
hearing bitching about the 8.3 implicit-cast-ectomy, which took away
only casts far less defensible than this one.

(2) you have not actually demonstrated an unacceptable consequence
of the above coding.  I will grant that using "localtimestamp" is
a cleaner and more efficient approach, but:

regression=# create table tt (f1 timestamp default current_timestamp,
regression(# f2 timestamp default localtimestamp);
CREATE TABLE
regression=# insert into tt default values;
INSERT 0 1
regression=# table tt;
            f1             |            f2             
---------------------------+---------------------------
 2017-03-14 11:13:31.78774 | 2017-03-14 11:13:31.78774
(1 row)

Looks to me like you get the same results after zone rotation happens.
(The same is true when the column type is timestamptz, btw.)

                        regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to