Re: [PATCH] Better logging of COPY queries if log_statement='all'

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Aleksander Alekseev <a(dot)alekseev(at)postgrespro(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Better logging of COPY queries if log_statement='all'
Date: 2016-10-17 14:21:44
Message-ID: f7203334-95b4-779a-f3ee-3319e6366861@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 10/17/2016 09:57 AM, Aleksander Alekseev wrote:
> 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
> ```

I'm not in favor of this, especially if it's not even optional.
log_statement is about logging, er, statements, not logging data.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2016-10-17 14:31:12 Re: Use EVP API pgcrypto encryption, dropping support for OpenSSL 0.9.6 and older
Previous Message Aleksander Alekseev 2016-10-17 13:57:54 [PATCH] Better logging of COPY queries if log_statement='all'