[HACKERS] Bug: timestamp without time zone column allows timestamptz default

Поиск
Список
Период
Сортировка
От David Fetter
Тема [HACKERS] Bug: timestamp without time zone column allows timestamptz default
Дата
Msg-id 20170314150905.GA21130@fetter.org
обсуждение исходный текст
Ответы Re: [HACKERS] Bug: timestamp without time zone column allows timestamptz default  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: David Steele
Дата:
Сообщение: Re: [HACKERS] PATCH: Configurable file mode mask
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Bug: timestamp without time zone column allows timestamptz default