Re: BUG #15145: date time default value issues

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: "dibxyooj96(at)gmail(dot)com" <dibxyooj96(at)gmail(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #15145: date time default value issues
Date: 2018-04-07 10:08:25
Message-ID: CAL9smLDzz90B3X7WcavJ+u8q=g4PqjAutVcORGj4hm=aq=tK2A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Apr 7, 2018 at 12:35 PM, David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> wrote:

> On Friday, April 6, 2018, David G. Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
> wrote:
>
>> On Friday, April 6, 2018, PG Bug reporting form <noreply(at)postgresql(dot)org>
>> wrote:
>>
>>> The following bug has been logged on the website:
>>>
>>> Bug reference: 15145
>>> Logged by: Paj Dib Xyooj
>>> Email address: dibxyooj96(at)gmail(dot)com
>>> PostgreSQL version: 9.4.5
>>> Operating system: (Ubuntu 4.8.2-19ubuntu1) 4.8.2, 64-bit
>>> Description:
>>>
>>> i set column "document_datenow timestamp with time zone NOT NULL DEFAULT
>>> now()"
>>> but the values that like this "0001-12-31 23:42:04+06:42:04 BC"
>>>
>>
>> What does typing "date" at your o/s command line show?
>>
>>
> So, that a constant time is used is not unusual, it's documented. Now()
> is a function that gets resolved at default creation.
>

That's not correct. You're thinking of DEFAULT 'now'. DEFAULT now()
works just fine.

.m

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2018-04-07 14:14:18 Re: BUG #15145: date time default value issues
Previous Message David G. Johnston 2018-04-07 09:35:08 Re: BUG #15145: date time default value issues