From: Bradley Kieser <brad@kieser.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PgSQL ADMIN <pgsql-admin@postgresql.org>
Subject: Re: Rules on a view overwrite default values. Any way to
Date: Mon, 03 Jan 2005 18:29:56 +0000
Message-ID: <41D98F24.3090208@kieser.net> (raw)
In-Reply-To: <24511.1104773538@sss.pgh.pa.us>
References: <41D97A9C.6050401@kieser.net>
<24511.1104773538@sss.pgh.pa.us>
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
>
>
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: brad@kieser.net, tgl@sss.pgh.pa.us
Subject: Re: Rules on a view overwrite default values. Any way to
In-Reply-To: <41D98F24.3090208@kieser.net>
References: <41D97A9C.6050401@kieser.net> <24511.1104773538@sss.pgh.pa.us> <41D98F24.3090208@kieser.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox