From: Mario Becroft <pgsql@becroft.co.nz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Mario Becroft <pgsql@becroft.co.nz>
Cc: pgsql-sql@postgresql.org
Subject: Re: Using rules to implement backward-compatible schema changes
Date: Tue, 01 Jan 2008 20:40:09 +1300
Message-ID: <87y7baouxy.fsf@server.ak.quickcircuit.co.nz> (raw)
In-Reply-To: <13418.1199171358@sss.pgh.pa.us>
References: <873atit7od.fsf@server.ak.quickcircuit.co.nz>
<13418.1199171358@sss.pgh.pa.us>
Tom Lane <tgl@sss.pgh.pa.us> writes:
> Mario Becroft <pgsql@becroft.co.nz> writes:
>> The problem is that when inserting to the view, default values do not
>> work as expected.
>
> You need to attach the defaults to the view, viz
>
> ALTER TABLE a ALTER COLUMN bar SET DEFAULT 5;
>
> This is considered a feature not a bug, since you might want a
> different default for inserts to the view than for inserts
> directly to the underlying table.
This crossed my mind, but I could not find a way of specifying defaults
for a view. I see now that it must be done with ALTER TABLE.
Thanks for your help with this problem.
--
Mario Becroft (postgres-related mail) <pgsql@becroft.co.nz>
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 using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: pgsql@becroft.co.nz, tgl@sss.pgh.pa.us
Subject: Re: Using rules to implement backward-compatible schema changes
In-Reply-To: <87y7baouxy.fsf@server.ak.quickcircuit.co.nz>
* 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