Re: Referencing OLD/NEW Rows on Trigger Definition

From: henryyipca(at)yahoo(dot)ca (Henry)
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Referencing OLD/NEW Rows on Trigger Definition
Date: 2004-08-18 22:01:37
Message-ID: b48a6e26.0408181219.72035814@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Seems to me you are hacking on way more than you want to. Take another
> look at your design and see if there isn't a smaller design struggling
> to get out. In particular, why are you touching any of the executor
> (which hardly deals in column names at all) rather than implementing the
> aliasing in plpgsql?
>
> regards, tom lane

Thanks for Tom's advices.

Here are my updated design.

1. modify backend\parser\gram.y and keyword.c to make an automatic alias
for OLD/NEW record (handle REFERENCING option) for CREATE TRIGGER query.
2. add two new fields (int old / char *identifier) into CreateTrigStmt
node struct to receive parameters from the CREATE TRIGGER query.
3. add one field (NameData tgidentifier) into CATALOG(pg_trigger) to store
the alias name.
4. add one field (char *identifier) into Trigger struct to store the alias
name for loading the trigger.
5. modify CreateTrigger() in trigger.c to insert new triggers into
pg_trigger with the new fields.
6. modify RelationBuildTriggers() in trigger.c for loading triggers with
new fields for the relation being accessed.
7. add supports to backend\node\equalfuncs.c and copyfuncs.c.

Any comments or advices would be appreciated.

Henry

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gavin Sherry 2004-08-18 23:40:28 Re: Tablespace and cpu costs
Previous Message Rodrigo Bonfa 2004-08-18 21:32:51 PostgreSQL as a DDBMS