From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Bernd Helmle <mailings(at)oopsware(dot)de>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: Thoughts about updateable views |
Date: | 2004-03-22 22:22:02 |
Message-ID: | 200403222222.i2MMM2J05117@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > I was thinking we create an updatable view if possible, and throw an
> > error if they try to insert/update/delete into a non-updatable view.
>
> Right.
>
> > Right now we ignore such activity, but that seems wrong.
>
> Nonsense.
>
> regression=# create view bar as select * from foo;
> CREATE VIEW
> regression=# insert into bar values (1);
> ERROR: cannot insert into a view
> HINT: You need an unconditional ON INSERT DO INSTEAD rule.
> regression=#
>
> The only backwards-compatibility risk I see is if there's a manually
> created ON-whatever rule; this probably has to override the automatic ones.
Oh, good. What release fixed this? I sure hope it is 7.5 because I
don't see any mention of it in the release notes. :-) I poked around
in CVS and can't see when it was added. No matter --- it is fixed now.
--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
From | Date | Subject | |
---|---|---|---|
Next Message | Matthew T. O'Connor | 2004-03-22 22:30:07 | Re: pg_autovacuum next steps |
Previous Message | Bruce Momjian | 2004-03-22 22:14:29 | My plans |