Re: Issue with default values and Rule - Mailing list pgsql-general

From Dev Kumkar
Subject Re: Issue with default values and Rule
Date
Msg-id CALSLE1Nfvp+LuJyZQO8LEvwu2qUwJtm-WXxOZG83DpBJJptqsg@mail.gmail.com
Whole thread Raw
In response to Re: Issue with default values and Rule  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
On Thu, Feb 27, 2014 at 11:17 PM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
That works because you said NULL is a valid value for the column. If you had specified NOT NULL then you would get an error about violating the NOT NULL constraint. Since you have said NULL is a valid value and you actually specified it in the INSERT the following applies:

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

DEFAULT default_expr
 ....

    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.

Hmm, so looks like there is no generic way out here to handle this in case of rules.

Regards...

pgsql-general by date:

Previous
From: James Harper
Date:
Subject: multiple results from a function
Next
From: Arun P.L
Date:
Subject: pgrestore command