[HACKERS] Bug: timestamp without time zone column allows timestamptz default - Mailing list pgsql-hackers

From David Fetter
Subject [HACKERS] Bug: timestamp without time zone column allows timestamptz default
Date
Msg-id 20170314150905.GA21130@fetter.org
Whole thread Raw
Responses Re: [HACKERS] Bug: timestamp without time zone column allows timestamptz default  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Folks,

What happens now:
   CREATE TABLE bar(id int DEFAULT 'a');   ERROR:  invalid input syntax for integer: "a"

Good so far.  Now with a different data type.
   CREATE TABLE bar(t TIMESTAMP WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP);   CREATE TABLE

This is a foot gun we need not have.  TIMESTAMP WITHOUT TIME ZONE is
already a foot gun for the vast majority of real world cases.  We
should not be making it worse by papering this over.

Ideally, this would look more like:
   CREATE TABLE bar(t TIMESTAMP WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP);   ERROR:  invalid input syntax for
timestampwithout time zone: current_timestamp   HINT: perhaps you meant to use timestamp with time zone.
 

Best,
David.
-- 
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david(dot)fetter(at)gmail(dot)com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate



pgsql-hackers by date:

Previous
From: David Steele
Date:
Subject: Re: [HACKERS] PATCH: Configurable file mode mask
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Bug: timestamp without time zone column allows timestamptz default