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



---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

Reply via email to