pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hannu Krosing <hannu@trust.ee>
To: Jan Wieck <jwieck@debis.com>
Cc: pgsql-hackers@postgreSQL.org
Cc: maillist@remo.demon.co.uk
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [HACKERS] RULE (and ALTER TABLE) questions
Date: Fri, 12 Feb 1999 19:09:41 +0200
Message-ID: <36C46055.50875098@trust.ee> (raw)
References: <m10B0Qv-000EBRC@orion.SAPserv.Hamburg.dsh.de>

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



view thread (2+ messages)  latest in thread

Message-ID: <36C46055.50875098@trust.ee>
Permalink:  ../36C46055.50875098@trust.ee/
Also on:    postgresql.org/message-id/36C46055.50875098@trust.ee

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: hannu@trust.ee, jwieck@debis.com, pgsql-hackers@postgreSQL.org, maillist@remo.demon.co.uk
  Subject: Re: [HACKERS] RULE (and ALTER TABLE) questions
  In-Reply-To: <36C46055.50875098@trust.ee>
  References: <m10B0Qv-000EBRC@orion.SAPserv.Hamburg.dsh.de> <36C46055.50875098@trust.ee>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox