Re: Inserting heap tuples in bulk in COPY

Поиск
Список
Период
Сортировка
От Florian Pflug
Тема Re: Inserting heap tuples in bulk in COPY
Дата
Msg-id 301C9F9C-F801-4F5E-9FDB-EAD56DB9A3D0@phlo.org
обсуждение исходный текст
Ответ на Inserting heap tuples in bulk in COPY  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: Inserting heap tuples in bulk in COPY  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-hackers
On Aug12, 2011, at 21:16 , Heikki Linnakangas wrote:
> Triggers complicate this. I believe it is only safe to group tuples together like this if the table has no triggers.
ABEFORE ROW trigger might run a SELECT on the table being copied to, and check if some of the tuples we're about to
insertexist. If we run BEFORE ROW triggers for a bunch of tuples first, and only then insert them, none of the trigger
invocationswill see the other rows as inserted yet. Similarly, if we run AFTER ROW triggers after inserting a bunch of
tuples,the trigger for each of the insertions would see all the inserted rows. 

Don't we run AFTER ROW triggers after inserting *all* the tuples anyway? At least this is what we do in the case of
INSERT/UPDATE/DELETEif I'm not mistaken. 

best regards,
Florian Pflug



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

Предыдущее
От: Gurjeet Singh
Дата:
Сообщение: Re: Inserting heap tuples in bulk in COPY
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: index-only scans