From: | "hubert depesz lubaczewski" <depesz(at)gmail(dot)com> |
---|---|
To: | "louis gonzales" <gonzales(at)linuxlouis(dot)net> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Practical question. |
Date: | 2007-03-17 04:39:21 |
Message-ID: | 9e4684ce0703162139r7bc64180ga47e854af9678967@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 3/16/07, louis gonzales <gonzales(at)linuxlouis(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | hubert depesz lubaczewski | 2007-03-17 04:43:28 | Re: exception handling in plperlu |
Previous Message | Tom Lane | 2007-03-17 01:30:48 | Re: Possible planner bug? |