Re: Issue with default values and Rule

From: Dev Kumkar <devdas(dot)kumkar(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Issue with default values and Rule
Date: 2014-02-28 04:31:28
Message-ID: CALSLE1Nfvp+LuJyZQO8LEvwu2qUwJtm-WXxOZG83DpBJJptqsg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Feb 27, 2014 at 11:17 PM, Adrian Klaver
<adrian(dot)klaver(at)aklaver(dot)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...

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Arun P.L 2014-02-28 07:41:01 pgrestore command
Previous Message Jason Daly 2014-02-28 02:54:58 'tuple concurrently updated' error when granting permissions