Re: Practical question. - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: Practical question.
Date
Msg-id 9e4684ce0703162139r7bc64180ga47e854af9678967@mail.gmail.com
Whole thread Raw
In response to Practical question.  (louis gonzales <gonzales@linuxlouis.net>)
Responses Re: Practical question.  (louis gonzales <gonzales@linuxlouis.net>)
List pgsql-general
On 3/16/07, louis gonzales <gonzales@linuxlouis.net> wrote:
> I want to write a statement-level trigger - one that happens once per
> statement - such that, immediately after an insert into a table(which
> gets a unique integer value as an ID from a defined sequence, being the
> primary key on the table), a new table is created with foreign key
> constraint on that unique ID.

hi,
i think what you;re trying to do is wrong - having that many tables
simply cannot work properly.
additionally - i think you're misinformed. the kind of action you
would like to "trigger on" is not "per statement" but "per row".
example:
insert into table x (field) select other_field from other_table;
if this insert would insert 10 records - "once per statement" trigger
would be called only once.

but anyway - what you're proposing will lead to many, many problems.
(plus it will never scale correctly).

depesz

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Possible planner bug?
Next
From: "hubert depesz lubaczewski"
Date:
Subject: Re: exception handling in plperlu