Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] datetime default 'now' broken?

From: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
To: "Henry B(dot) Hotz" <hotz(at)jpl(dot)nasa(dot)gov>
Cc: Brett McCormickS <brett(at)abraxas(dot)scene(dot)com>, pgsql-hackers(at)hub(dot)org
Subject: Re: [HACKERS] datetime default 'now' broken?
Date: 1998-03-17 02:35:32
Message-ID: 350DE174.19E1738D@alumni.caltech.edu (view raw or flat)
Thread:
Lists: pgsql-hackers
> >> If I create a table with a datetime field with a default of 'now',
> >> every insert the value is the time of table creation instead of the
> >> time of insert, which is how it behaved in previous releases (I 
> >> think this was even documented).
> >
> >I can't recall it ever working that way, though before we discovered
> >that it didn't we all assumed that it _did_ work that way :)
> 
> I'm running 6.1.1 and I *depend* on 'now' giving me the real now in an
> insert.  I guess I'm glad I never upgraded.

Hi Henry. You're missing a lot by not upgrading. DEFAULT clauses on
tables which Brett was asking about aren't even available pre-v6.2. The
'now' behavior in default clauses was an unexpected side-effect of the
optimizer, which evaluates things which look like constants before
execution.

Give me a call during the day at x47797 if you have any other
reservations about upgrading...

                   - Tom

In response to

pgsql-hackers by date

Next:From: The Hermit HackerDate: 1998-03-17 02:47:57
Subject: Re: [HACKERS] Re: [PATCHES] patches for 6.2.1p6
Previous:From: Jackson, DeJuanDate: 1998-03-17 02:14:09
Subject: RE: [HACKERS] RE: [QUESTIONS] The Complete and Ccomprehensive list of Newbie qu

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group