Re: Column Default Clause and User Defined Functions

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Keary Suska <hierophant(at)pcisys(dot)net>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Column Default Clause and User Defined Functions
Date: 2007-06-28 00:23:32
Message-ID: BC501E55-34E3-4F3A-B2F6-C116DDA38196@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Danyelle Gragsone 2007-06-28 00:34:19 Re: postgres and webmin
Previous Message Eddy D. Sanchez 2007-06-27 23:58:58 Image Archiving with postgres