Re: using queries as default value? - Mailing list pgsql-novice

From Tom Lane
Subject Re: using queries as default value?
Date
Msg-id 15774.1054336014@sss.pgh.pa.us
Whole thread Raw
In response to using queries as default value?  (Don Patou <pknoob@noos.fr>)
Responses Re: using queries as default value?
List pgsql-novice
Don Patou <pknoob@noos.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

pgsql-novice by date:

Previous
From: Nabil Sayegh
Date:
Subject: Re: using queries as default value?
Next
From: Peter Bierman
Date:
Subject: why doesn't an index help my simple query?