Re: [HACKERS] RULE (and ALTER TABLE) questions

From: Hannu Krosing <hannu(at)trust(dot)ee>
To: Jan Wieck <jwieck(at)debis(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org, maillist(at)remo(dot)demon(dot)co(dot)uk, pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [HACKERS] RULE (and ALTER TABLE) questions
Date: 1999-02-12 17:09:41
Message-ID: 36C46055.50875098@trust.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

Jan Wieck wrote:
>
> > These could probably be implemened more effectively using rules. Having
> > the
> > rules generated automatically for simple cases would of course be nice,
> > but a warning at least should be given to user about creating the rule,
> > like it's currently done with primary key.
>
> No it can't.
>
> Such a rule would look like
>
> CREATE RULE xxx AS ON INSERT TO this_table
> DO INSTEAD INSERT INTO this_table ...
>
> The rule system will be triggerd on an INSERT INTO
> this_table, rewrite and generate another parsetree that is an
> INSERT INTO this_table, which is recursively rewritten again
> applying rule xxx...
>
> That's an endless recursion. A rule can never do the same
> operation to a table it is fired for.

But when doing that at the table creation time, then the table can
actually
be defined as a view on storage table and rules for insert update and
delete
be defined for this view that do the actual data manipulation on the
storage table.

Or is the rule system currently not capable for this ?

When some field is changed to UPPER-ONLY status using alter table, the
table
could be renamed to staorage table and all the rules be created ?

And the other question - what is the status of ALTER TABLE commands -
can we add/remove/disable constraints without recreating the table ?

Is constraint and index disabling supported at all ?

-------------------
Hannu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 1999-02-12 19:16:57 Re: [HACKERS] RULE (and ALTER TABLE) questions
Previous Message Bruce Momjian 1999-02-12 16:28:39 Re: [HACKERS] Optimizer is fixed, and faster

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Wieck 1999-02-12 19:16:57 Re: [HACKERS] RULE (and ALTER TABLE) questions
Previous Message Roberto Joao Lopes Garcia 1999-02-12 16:20:46 DEFAULT TEXT 'now' in create table