pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Iwata, Aya <iwata.aya@jp.fujitsu.com>
Cc: Jamison, Kirk <k.jamison@jp.fujitsu.com>
Cc: Nagaura, Ryohei <nagaura.ryohei@jp.fujitsu.com>
Cc: Jacob Champion <pchampion@pivotal.io>
Cc: Jim Doty <jdoty@pivotal.io>
Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Cc: nagata@sraoss.co.jp <nagata@sraoss.co.jp>
Cc: Haribabu Kommi <kommi.haribabu@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Subject: Re: libpq debug log
Date: Fri, 22 Feb 2019 13:51:56 -0500
Message-ID: <19535.1550861516@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmobviA3E6JH4ohq50FvvL8Lo1=jGKR3t2L196J3CjVeQJg@mail.gmail.com>
References: <71E660EB361DF14299875B198D4CE5423DE3FBA4@g01jpexmbkw25>
	<20180827215124.0cdb4d0cb99136b5a86b1d9f@sraoss.co.jp>
	<71E660EB361DF14299875B198D4CE5423DE4A154@g01jpexmbkw25>
	<4bc9abbd-44a0-1787-b410-4e68b5ab3228@2ndquadrant.com>
	<71E660EB361DF14299875B198D4CE5423DE5ADB3@g01jpexmbkw25>
	<71E660EB361DF14299875B198D4CE5423DE758BB@g01jpexmbkw25>
	<CABAq_6HETsCjv5vf_HXKM+A9smW8P-GVH0iuZ-1Y8RiwQ8eZ+w@mail.gmail.com>
	<71E660EB361DF14299875B198D4CE5423DE804A9@g01jpexmbkw25>
	<71E660EB361DF14299875B198D4CE5423DE82363@g01jpexmbkw25>
	<ae75c8a3-95bd-37d2-bfc1-c0a11b347538@2ndquadrant.com>
	<71E660EB361DF14299875B198D4CE5423DE83937@g01jpexmbkw25>
	<71E660EB361DF14299875B198D4CE5423DE99C79@g01jpexmbkw25>
	<71E660EB361DF14299875B198D4CE5423DEB31F4@g01jpexmbkw25>
	<71E660EB361DF14299875B198D4CE5423DEB9E4B@g01jpexmbkw25>
	<EDA4195584F5064680D8130B1CA91C453BF258@G01JPEXMBYT04>
	<71E660EB361DF14299875B198D4CE5423DED92AD@g01jpexmbkw25>
	<D09B13F772D2274BB348A310EE3027C643BC5C@g01jpexmbkw24>
	<CA+Tg! mobk5BN+AueB0Pyh13yK4B1_1+M612gT-p9FgEgF5GNSrw@mail.gmail.com>
	<71E660EB361DF14299875B198D4CE5423DEDA4CF@g01jpexmbkw25>
	<CA+TgmobviA3E6JH4ohq50FvvL8Lo1=jGKR3t2L196J3CjVeQJg@mail.gmail.com>

Robert Haas <robertmhaas@gmail.com> writes:
> On Thu, Feb 21, 2019 at 7:52 PM Iwata, Aya <iwata.aya@jp.fujitsu.com> wrote:
>> Aside from problems with my current documentation which I will fix,
>> could you explain more detail about the problem of the design?

> We already have a PQtrace() facility that could be improved, and it
> has been previously suggested that you work on improving this facility
> rather than inventing something new.  I still think that's a good
> idea.

Me too.  PQtrace as currently constituted might be helpful for debugging
libpq itself, but it's nigh useless for any higher-level purpose.  I'd
gladly toss overboard any hypothetical use-case for what it does now,
in favor of having something that dumps stuff at the logical level of
messages.  (It's not even very consistent, because somebody did add a
more-or-less-message-level printout to pqSaveParameterStatus, which
I believe is duplicative of what fe-misc.c will print about the
same interaction at the byte level.)

> Instead you've created a second way of producing similar
> information, and then coupled it to very specific ideas about how that
> information should be logged: it is triggered by new libpq parameters,
> there is log rotation logic, etc.  Those might not be right for
> everyone, and there's no flexibility in the mechanism.

Good point.  To the extent that people want any of that, they'd probably
want to have application control over it.  Maybe, in addition to
PQtrace(FILE *) that'd just dump to a stdio stream, there should be a way
to create a callback similar to a notice-message hook, and let the
application implement such features in a custom callback.

> I am not sure that it's a good idea to have facilities that write to
> the local filesystem that can be triggered by libpq parameters.

Oy.  That seems like a *very* serious objection.  I agree with Robert's
thought that it'd be better to insist on application involvement in
enabling trace output.

			regards, tom lane




view thread (234+ messages)  latest in thread

Message-ID: <19535.1550861516@sss.pgh.pa.us>
Permalink:  ../19535.1550861516@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19535.1550861516@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, iwata.aya@jp.fujitsu.com, k.jamison@jp.fujitsu.com, nagaura.ryohei@jp.fujitsu.com, pchampion@pivotal.io, jdoty@pivotal.io, nagata@sraoss.co.jp, kommi.haribabu@gmail.com, peter.eisentraut@2ndquadrant.com
  Subject: Re: libpq debug log
  In-Reply-To: <19535.1550861516@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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