Re: Using rules to implement backward-compatible schema changes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mario Becroft <pgsql(at)becroft(dot)co(dot)nz>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Using rules to implement backward-compatible schema changes
Date: 2008-01-01 07:09:18
Message-ID: 13418.1199171358@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Mario Becroft <pgsql(at)becroft(dot)co(dot)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.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Mario Becroft 2008-01-01 07:40:09 Re: Using rules to implement backward-compatible schema changes
Previous Message Mario Becroft 2008-01-01 05:51:30 Using rules to implement backward-compatible schema changes