Re: Thoughts about updateable views

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: Jaime Casanova <systemguards(at)yahoo(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Thoughts about updateable views
Date: 2004-12-22 16:25:42
Message-ID: 4402.1103732742@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Richard Huxton <dev(at)archonet(dot)com> writes:
> There are two things (AFAICT) you need to be able to do to update (NOTE
> - not insert) a view.
> 1. Identify the underlying table(s) for the updated column(s)
> 2. Identify (primary) key values for the table(s) being updated.
> So - I could have a join listing users and how many email aliases they
> have (so sum()) and still update their name, so long as the key for the
> users table was present in the view.

No; you'd also have to have some guarantee that a given underlying table
row gives rise to at most one join row. If the same table row gives
rise to multiple join rows, then a request specifying an UPDATE of just
one of those join rows can't be satisfied.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-12-22 16:32:41 Re: Can't Restart ver 8.0b3
Previous Message Tom Lane 2004-12-22 16:19:16 Re: strcoll_l an new approach for locale per column