Re: Column Default Clause and User Defined Functions - Mailing list pgsql-general

From Michael Glaesemann
Subject Re: Column Default Clause and User Defined Functions
Date
Msg-id BC501E55-34E3-4F3A-B2F6-C116DDA38196@seespotcode.net
Whole thread Raw
In response to Column Default Clause and User Defined Functions  (Keary Suska <hierophant@pcisys.net>)
Responses Re: Column Default Clause and User Defined Functions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Jun 27, 2007, at 18:18 , Keary Suska wrote:

> Is it possible to have a user-defined function (a plpqsql function)
> as the
> argument to a default clause that issues SELECTs on other tables?

Not according to the documentation:

http://www.postgresql.org/docs/8.2/interactive/sql-createtable.html

> DEFAULT default_expr
>
>     The DEFAULT clause assigns a default data value for the column
> whose column definition it appears within. The value is any
> variable-free expression (subqueries and cross-references to other
> columns in the current table are not allowed). The data type of the
> default expression must match the data type of the column.
>
>     The default expression will be used in any insert operation
> that does not specify a value for the column. If there is no
> default for a column, then the default is null.


Michael Glaesemann
grzm seespotcode net



pgsql-general by date:

Previous
From: "Eddy D. Sanchez"
Date:
Subject: Image Archiving with postgres
Next
From: "Danyelle Gragsone"
Date:
Subject: Re: postgres and webmin