Re: Rules on a view overwrite default values. Any way to - Mailing list pgsql-admin

From Bradley Kieser
Subject Re: Rules on a view overwrite default values. Any way to
Date
Msg-id 41D98F24.3090208@kieser.net
Whole thread Raw
In response to Re: Rules on a view overwrite default values. Any way to reinstate them?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-admin
Thanks Tom and Stephan!

This works perfectly!

Brad


Tom Lane wrote:

>Bradley Kieser <brad@kieser.net> writes:
>
>
>>The problem is that rules on a view mean that the default values for NOT
>>NULL columns (used extensively) no longer trigger!
>>
>>
>
>The way you're supposed to fix this is to attach default values to the
>view itself.
>
>ALTER TABLE myview ALTER COLUMN updated_time SET DEFAULT now();
>
>Now an INSERT on myview will include the correct expression before view
>expansion happens.
>
>I'm not sure how long we've had this, but it's definitely in 7.4.
>
>            regards, tom lane
>
>
>

pgsql-admin by date:

Previous
From: Amauri Pimenta
Date:
Subject: Problems with Postgresql 8.0.0
Next
From: "Chris Hoover"
Date:
Subject: How to calculate row sizes