Re: File content logging during execution of COPY queries

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Grigory Smolkin <g(dot)smolkin(at)postgrespro(dot)ru>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: File content logging during execution of COPY queries
Date: 2016-10-20 15:14:48
Message-ID: 20161020151447.GS13284@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Grigory,

* Grigory Smolkin (g(dot)smolkin(at)postgrespro(dot)ru) wrote:
> On 10/20/2016 12:36 PM, 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.
> >>>This use-case doesn't really make much sense to me. Can you explain it
> >>>in more detail? Is the goal here to replicate all of the statements
> >>>that are changing data in the database?
> >>The idea is to record application workload in real environment and write
> >>a benchmark based on this record. Then using this benchmark we could try
> >>different OS/DBMS configuration (or maybe hardware), find an extremum,
> >>then change configuration in production environment.
> >>
> >>It's not always possible to change an application or even database (e.g.
> >>to use triggers) for this purpose. For instance, if DBMS is provided as
> >>a service.
> >>
> >>Currently PostgreSQL allows to record all workload _except_ COPY
> >>queries. Considering how easily it could be done I think it's wrong.
> >>Basically the only real question here is how it should look like in
> >>postgresql.conf.
> >OK, how about introducing a new boolean parameter named log_copy?
> >Corresponding patch is attached.
>
> This is a useful feature I was waiting for some time.
> If some application which workload you want to collect is using COPY
> statement, then recording network traffic was your only option.

As I pointed out to Aleksander, you would still need to record network
traffic to see all of the data going to and from the database since we
do not include SELECT or ... RETURNING results in the log files. If
that is needed then that's a whole different discussion.

Thanks!

Stephen

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Petr Jelinek 2016-10-20 15:14:51 Re: Indirect indexes
Previous Message Robert Haas 2016-10-20 15:11:50 Re: Renaming of pg_xlog and pg_clog