Re: [COMMITTERS] pgsql: Automatic view update rules Bernd Helmle

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gregory Stark <stark(at)enterprisedb(dot)com>
Cc: Bernd Helmle <mailings(at)oopsware(dot)de>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [COMMITTERS] pgsql: Automatic view update rules Bernd Helmle
Date: 2009-01-25 01:42:47
Message-ID: 3156.1232847767@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:
>> ON UPDATE DO INSTEAD SUBSTITUTE base_table [ (base_column_name, ...) ]
>> [ WHERE ... ]
>>
>> ON UPDATE DO INSTEAD
>> UPDATE base_table SET base_col_1 = new.derived_col_1, base_col_2 ...
>> WHERE CURRENT OF VIEW;

> What would happen with these if the view is defined with "SELECT *" and I add
> a new column or drop columns from the table?

Nothing, just as happens now, because the * got expanded to a set column
list by the parser before the view ever got defined.

> This same machinery isn't present in the normal executor is it? I mean, if I
> can update a view then ISTM I should be able to update a view written inline
> in the query like:
> UPDATE (select * from a where x=1) set y=2

That is not a view; the primary reason why not being that there are no
applicable rules.

regards, tom lane

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2009-01-25 01:47:20 Re: [COMMITTERS] pgsql: Automatic view update rules Bernd Helmle
Previous Message Bernd Helmle 2009-01-24 20:49:22 Re: [COMMITTERS] pgsql: Automatic view update rules Bernd Helmle

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-01-25 01:47:20 Re: [COMMITTERS] pgsql: Automatic view update rules Bernd Helmle
Previous Message Robert Haas 2009-01-25 01:41:11 Re: SE-PostgreSQL Updated Revision (r1460)