Re: [BUGS] 'Default' troubles again. This time with time :)))

From: Leon <leon(at)udmnet(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: bughunters <pgsql-bugs(at)postgreSQL(dot)org>
Subject: Re: [BUGS] 'Default' troubles again. This time with time :)))
Date: 1999-07-18 16:29:31
Message-ID: 379200EB.B020F210@udmnet.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tom Lane wrote:

>
> > [ default value doesn't change over time ]
>
> This oughta be in the FAQ I think ...
>
> When you write a simple constant default, it gets coerced to the target
> data type before the default information is stored. So, what you
> effectively did was to create table dd with a default value for gg
> of the time at which you executed 'create table'.
>

Tom! I tested your method of creating table with
create table ww (aa int4, bb timestamp default text 'now'),
and it didn't work either! (BTW, this is exactly the way docs suggest
doing it.) See? I promised to deliver a real bug and I did it! :)))

Yes, docs mumble something about 'cacheable' and 'non-cacheable'
functions, but it is not clear to me how Postgres discerns them.

It is complete puzzle to me why 'USER' is cacheable and 'CURRENT_TIMESTAMP'
is not. This distinction, I think, should be made clearer. Maybe in
the sensible form of two-column table in the docs. :) One column is
function name, the other is 'cacheability'.

--
Leon.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 1999-07-18 20:11:10 Re: [BUGS] 'Default' troubles again. This time with time :)))
Previous Message Tom Lane 1999-07-18 14:27:31 Re: [BUGS] 'Default' troubles again. This time with time :)))