From: Bernd Helmle <mailings(at)oopsware(dot)de>
To: PostgreSQL-Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject:
Date: 2004-10-26 11:02:27
Message-ID: DC72307766EB062E397C878E@sparkey.oopsware.intra
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

[sorry if this mail appears more than once, but it seems the others didn't
make it through the list]

This is a short preview on the view update code i'm currently working on.
It is far away from being ready, but i want to share the current code and
get some hints, what things have to be made better:

http://www.oopsware.de/pgsql/pgsql-view_update.tar.gz

The patchfile is against beta4, view_update.h belongs to
src/include/rewrite, view_update.c to src/backend/rewrite. The code
requires an initdb, however, the catalog change contained in this code is
used but not very useful yet.

The code has the following known problems:

- User defined update rules on views are created without any intervention
from the code. This is why the rule regression tests (and others) fails,
because there suddenly are two INSERT/UPDATE/DELETE rules....

- Indexed array fields in a view columns list causes SIGSEGV (due to some
experiments i do with array subscripting operations).

- There are problems with NULL fields in WHERE conditions.

- gram.y is only an ugly hack to get the CHECK OPTION working. needs deeper
efforts, because it makes WITH a reserved keyword....

The following items needs deeper discussion i think:

- DEFAULT values on the underlying base tables needs to be specified
explicitly to the view itself (via ALTER TABLE), another problem are
SERIALs ...
- What should happen, if someone throws a pg_dump or sql script at the
backend, that holds own update rules for a view? in this case the implicit
ones should be removed or deactivated ....
- the code only supports cascaded rules and all rules are created on the
base relations only. So if one underlying base relation is not updateable,
the view itself is not updateable, too.

--
TIA
Bernd

Responses

  • Re: at 2004-10-26 20:44:10 from Hannu Krosing

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2004-10-26 12:09:53 Re: plans for bitmap indexes?
Previous Message Simon Riggs 2004-10-26 09:50:58 Re: [PATCHES] ARC Memory Usage analysis