Re: Practical question.
От | hubert depesz lubaczewski |
---|---|
Тема | Re: Practical question. |
Дата | |
Msg-id | 9e4684ce0703162139r7bc64180ga47e854af9678967@mail.gmail.com обсуждение исходный текст |
Ответ на | Practical question. (louis gonzales <gonzales@linuxlouis.net>) |
Ответы |
Re: Practical question.
|
Список | 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 по дате отправления: