Re: ALTER TABLE ... SET DEFAULT

From: Brian McCane <bmccane(at)mccons(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: ALTER TABLE ... SET DEFAULT
Date: 2002-04-13 00:43:17
Message-ID: 20020412194103.R59745-100000@fw.mccons.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


Okay, so if I create a function as 'iscachable', it assumes that the value
will never change, calls the function and places the value in as the
default? This doesn't make sense to me since the 'iscacheable' only works
inside of a transaction block. If I call my function a hundred times, I
get a hundred different answers. Once I do a 'BEGIN', the result never
changes again until I 'COMMIT', which is what I would expect according to
the docs I have found.

- brian

On Fri, 12 Apr 2002, Tom Lane wrote:

>
> Brian McCane <bmccane(at)mccons(dot)net> writes:
> > Been there, done that :). It put the current epoch value in as the
> > default value for updated.
>
> That would suggest that you marked since_epoch() as cachable. Wrong
> thing to do, if you want it evaluated again every time the default
> is used.
>
> regards, tom lane
>

Wm. Brian McCane | Life is full of doors that won't open
Search http://recall.maxbaud.net/ | when you knock, equally spaced amid those
Usenet http://freenews.maxbaud.net/ | that open when you don't want them to.
Auction http://www.sellit-here.com/ | - Roger Zelazny "Blood of Amber"

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2002-04-13 02:53:21 Re: ALTER TABLE ... SET DEFAULT
Previous Message Tom Lane 2002-04-13 00:30:00 Re: ALTER TABLE ... SET DEFAULT