| 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:07:47 |
| Message-ID: | 200403222207.i2MM7lO02995@candle.pha.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Tom Lane wrote:
> Bernd Helmle <mailings(at)oopsware(dot)de> writes:
> > a) Definition of an updateable view?
>
> > The first thing what i thought about was, what defines a updateable view.
>
> The SQL spec clearly defines the requirements for a view to be
> updateable. It seems sufficient to me to handle the cases required by
> the spec.
>
> > b) The creation of an automatic INSERT/UPDATE or DELETE Rule had to be done
> > with
> > the creation of the SELECT Rule. I understand how PostgreSQL handles views
> > with its Rule
> > System, but what happens when no appropiate Rule can be created?
>
> You don't create it. This corresponds to the view not being updateable.
> AFAICS the spec expects CREATE VIEW to create both kinds of view without
> the implementation making any particular comment about it.
>
> We might need to mark automatically created rules as such, and be
> prepared to drop them if the user then defines a manually-created rule.
> Otherwise we will have backwards-compatibility problems with existing
> databases.
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 now we ignore such activity, but that seems wrong.
--
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 | Tom Lane | 2004-03-22 22:11:26 | Re: Thoughts about updateable views |
| Previous Message | Tom Lane | 2004-03-22 21:56:08 | Re: pg_autovacuum next steps |