Re: Referencing OLD/NEW Rows on Trigger Definition

Поиск
Список
Период
Сортировка
От henryyipca@yahoo.ca (Henry)
Тема Re: Referencing OLD/NEW Rows on Trigger Definition
Дата
Msg-id b48a6e26.0408181219.72035814@posting.google.com
обсуждение исходный текст
Ответ на Referencing OLD/NEW Rows on Trigger Definition  (henryyipca@yahoo.ca (Henry))
Список 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Rodrigo Bonfa
Дата:
Сообщение: PostgreSQL as a DDBMS
Следующее
От: Christopher Browne
Дата:
Сообщение: Re: [ADMIN] Pseudo-Off-topic-survey: Opinions about future of Postgresql(MySQL)?