Re: ALTER TABLE ... SET DEFAULT - Mailing list pgsql-admin

From Brian McCane
Subject Re: ALTER TABLE ... SET DEFAULT
Date
Msg-id 20020412194103.R59745-100000@fw.mccons.net
Whole thread Raw
In response to Re: ALTER TABLE ... SET DEFAULT  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: ALTER TABLE ... SET DEFAULT  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: ALTER TABLE ... SET DEFAULT  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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@mccons.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"


pgsql-admin by date:

Previous
From: Tom Lane
Date:
Subject: Re: ALTER TABLE ... SET DEFAULT
Next
From: Tom Lane
Date:
Subject: Re: ALTER TABLE ... SET DEFAULT