Re: using queries as default value?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Don Patou <pknoob(at)noos(dot)fr>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: using queries as default value?
Date: 2003-05-30 23:06:54
Message-ID: 15774.1054336014@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Don Patou <pknoob(at)noos(dot)fr> writes:
> is it possible to have a query as a column default value.

Not directly, but you can fake it by hiding the query in an SQL or PL
function that you call in the DEFAULT expression.

I agree with the nearby replies questioning whether this is really what
you want to do at all ... but if it's, that's how.

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Peter Bierman 2003-05-30 23:54:34 why doesn't an index help my simple query?
Previous Message Nabil Sayegh 2003-05-30 22:31:32 Re: using queries as default value?