[PATCH] Better logging of COPY queries if log_statement='all' - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject [PATCH] Better logging of COPY queries if log_statement='all'
Date
Msg-id 20161017135753.GA6204@e733.localdomain
Whole thread Raw
Responses Re: [PATCH] Better logging of COPY queries if log_statement='all'
List pgsql-hackers
Hello.

Sometimes it's useful to log content of files used in COPY ... TO ... and
COPY ... FROM ... queries. Unfortunately PostgreSQL doesn't allow to do
it, even if log_statement='all'. Suggested patch fixes this.

Log example:

```
LOG:  statement: create table test (k int, v text);
LOG:  statement: insert into test values (111, 'aaa'), (222, 'bbb');
LOG:  statement: copy test to '/tmp/copy.txt';
LOG:  statement: 111    aaa
LOG:  statement: 222    bbb
LOG:  statement: delete from test;
LOG:  statement: copy test from '/tmp/copy.txt';
LOG:  statement: 111    aaa
LOG:  statement: 222    bbb
```
--
Best regards,
Aleksander Alekseev

Attachment

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: postgres_fdw super user checks
Next
From: Andrew Dunstan
Date:
Subject: Re: [PATCH] Better logging of COPY queries if log_statement='all'