Re: [PATCH] Better logging of COPY queries if log_statement='all'
От | Daniel Verite |
---|---|
Тема | Re: [PATCH] Better logging of COPY queries if log_statement='all' |
Дата | |
Msg-id | 754a2e41-3324-42f7-acd4-d22c9b7a3ae6@mm обсуждение исходный текст |
Ответ на | Re: [PATCH] Better logging of COPY queries if log_statement='all' (Aleksander Alekseev <a.alekseev@postgrespro.ru>) |
Список | pgsql-hackers |
Aleksander Alekseev wrote: > According to my colleagues it would be very nice to have this feature. > For instance, if you are trying to optimize PostgreSQL for application > that uses COPY and you don't have access to or something like this. > It could also be useful in some other cases. Outside of the app, what can be already set up is an AFTER INSERT FOR EACH ROW trigger that essentially does: raise LOG, '%', NEW; The main drawback of this approach is that, for each line of data emitted to the log, there's another STATEMENT: copy... line added. But that might be not too bad for certain uses. Ideally we should be able to access the new rowset as a whole through a statement-level trigger. In that case, the data could be logged in a one-shot operation by that trigger. There's a related item in the TODO list: "Allow statement-level triggers to access modified rows" and an old thread on -hackers here: https://www.postgresql.org/message-id/20060522150647.GE24404@svana.org that discussed this topic in relation to MSSQL having this functionality. Best regards, -- Daniel Vérité PostgreSQL-powered mailer: http://www.manitou-mail.org Twitter: @DanielVerite
В списке pgsql-hackers по дате отправления: