pg.ddx.io pgsql-performance@postgresql.org mailing list archive
help / color / mirror / Atom feed"COPY TO stdout" statements occurrence in log files
4+ messages / 4 participants
[nested] [flat]
* "COPY TO stdout" statements occurrence in log files
@ 2011-01-14 19:42 Fernando Mertins <fernando.mertins@gmail.com>
2011-01-14 20:27 ` Re: "COPY TO stdout" statements occurrence in log files Maciek Sakrejda <msakrejda@truviso.com>
0 siblings, 1 reply; 4+ messages in thread
From: Fernando Mertins @ 2011-01-14 19:42 UTC (permalink / raw)
To: pgsql-performance
Hi there,
I have one log file per week and logging all statements >= 500 ms execution
time.
But, with "normal" statements are occuring something like this:
2011-01-13 00:11:38 BRT LOG: duration: 2469.000 ms statement: FETCH 1000
IN bloboid
2011-01-13 00:12:01 BRT LOG: duration: 797.000 ms statement: SELECT
tableoid, oid, nspname, (SELECT rolname FROM pg_catalog.pg_roles WHERE oid =
nspowner) as rolname, nspacl FROM pg_namespace
2011-01-13 00:12:06 BRT LOG: duration: 766.000 ms statement:
*COPY*public.log (codlog, matricula, data, descricao, codcurso, ip)
WITH OIDS
*TO stdout; *
2011-01-13 00:12:10 BRT LOG: duration: 2328.000 ms statement: FETCH 1000
IN bloboid
2011-01-13 00:12:34 BRT LOG: duration: 594.000 ms statement: SELECT
tableoid, oid, nspname, (SELECT rolname FROM pg_catalog.pg_roles WHERE oid =
nspowner) as rolname, nspacl FROM pg_namespace
2011-01-13 00:12:38 BRT LOG: duration: 672.000 ms statement:
*COPY*public.avaliacao_topico_opcao (codavaliacao_topico_opcao,
codavaliacao_topico, descricao, selecao) WITH OIDS *TO stdout; *
2011-01-13 00:12:39 BRT LOG: duration: 891.000 ms statement: COPY
public.log (codlog, matricula, data, descricao, codcurso, ip) WITH OIDS TO
stdout;
Is this normal? I'm afraid because my application doesn't run this kind of
statement, so how can I know what is doing these commands? Maybe pg_dump?
Thank you!
Fernando
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: "COPY TO stdout" statements occurrence in log files
2011-01-14 19:42 "COPY TO stdout" statements occurrence in log files Fernando Mertins <fernando.mertins@gmail.com>
@ 2011-01-14 20:27 ` Maciek Sakrejda <msakrejda@truviso.com>
2011-01-14 21:19 ` Re: "COPY TO stdout" statements occurrence in log files Chris Browne <cbbrowne@acm.org>
0 siblings, 1 reply; 4+ messages in thread
From: Maciek Sakrejda @ 2011-01-14 20:27 UTC (permalink / raw)
To: Fernando Mertins <fernando.mertins@gmail.com>; +Cc: pgsql-performance
> Is this normal? I'm afraid because my application doesn't run this kind of
> statement, so how can I know what is doing these commands? Maybe pg_dump?
I think pg_dump is likely, yes, if you have that scheduled. I don't
think anything in the log file will identify it as pg_dump explicitly
(I believe as far as the server is concerned, pg_dump is just another
client), but if you're concerned about this, you can add the client
pid (%p) to log_line_prefix in postgresql.conf, log the pg_dump pid
through whatever mechanism manages that, and compare.
---
Maciek Sakrejda | System Architect | Truviso
1065 E. Hillsdale Blvd., Suite 215
Foster City, CA 94404
(650) 242-3500 Main
msakrejda@truviso.com
www.truviso.com
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: "COPY TO stdout" statements occurrence in log files
2011-01-14 19:42 "COPY TO stdout" statements occurrence in log files Fernando Mertins <fernando.mertins@gmail.com>
2011-01-14 20:27 ` Re: "COPY TO stdout" statements occurrence in log files Maciek Sakrejda <msakrejda@truviso.com>
@ 2011-01-14 21:19 ` Chris Browne <cbbrowne@acm.org>
2011-01-14 22:42 ` Re: "COPY TO stdout" statements occurrence in log files Marti Raudsepp <marti@juffo.org>
0 siblings, 1 reply; 4+ messages in thread
From: Chris Browne @ 2011-01-14 21:19 UTC (permalink / raw)
To: pgsql-performance
msakrejda@truviso.com (Maciek Sakrejda) writes:
>> Is this normal? I'm afraid because my application doesn't run this kind of
>> statement, so how can I know what is doing these commands? Maybe pg_dump?
>
> I think pg_dump is likely, yes, if you have that scheduled. I don't
> think anything in the log file will identify it as pg_dump explicitly
> (I believe as far as the server is concerned, pg_dump is just another
> client), but if you're concerned about this, you can add the client
> pid (%p) to log_line_prefix in postgresql.conf, log the pg_dump pid
> through whatever mechanism manages that, and compare.
That's an option... More are possible...
1. Our DBAs have been known to create users specifically for doing
backups ("dumpy"). It doesn't seem like a *huge* proliferation of users
to have some 'utility' user names for common processes.
2. In 9.1, there will be a new answer, as there's a GUC to indicate the
"application_name".
--
"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe trying
to produce bigger and better idiots. So far, the Universe is
winning." -- Rich Cook
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: "COPY TO stdout" statements occurrence in log files
2011-01-14 19:42 "COPY TO stdout" statements occurrence in log files Fernando Mertins <fernando.mertins@gmail.com>
2011-01-14 20:27 ` Re: "COPY TO stdout" statements occurrence in log files Maciek Sakrejda <msakrejda@truviso.com>
2011-01-14 21:19 ` Re: "COPY TO stdout" statements occurrence in log files Chris Browne <cbbrowne@acm.org>
@ 2011-01-14 22:42 ` Marti Raudsepp <marti@juffo.org>
0 siblings, 0 replies; 4+ messages in thread
From: Marti Raudsepp @ 2011-01-14 22:42 UTC (permalink / raw)
To: Chris Browne <cbbrowne@acm.org>; +Cc: pgsql-performance@postgresql.org, Fernando Mertins <fernando.mertins@gmail.com>
On Fri, Jan 14, 2011 at 23:19, Chris Browne <cbbrowne@acm.org> wrote:
> 2. In 9.1, there will be a new answer, as there's a GUC to indicate the
> "application_name".
Actually this was already introduced in PostgreSQL 9.0 :)
You can add application_name to your log_line_prefix with %a. For
pg_dump it will display "pg_dump"
Regards,
Marti
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2011-01-14 22:42 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-01-14 19:42 "COPY TO stdout" statements occurrence in log files Fernando Mertins <fernando.mertins@gmail.com>
2011-01-14 20:27 ` Maciek Sakrejda <msakrejda@truviso.com>
2011-01-14 21:19 ` Chris Browne <cbbrowne@acm.org>
2011-01-14 22:42 ` Marti Raudsepp <marti@juffo.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox