Re: Plug-in common/logging.h with vacuumlo and oid2name

2019-09-05 Thread Michael Paquier
On Thu, Sep 05, 2019 at 09:59:51AM -0400, Alvaro Herrera wrote: > Patch looks good to me, please push. Thanks, applied without the calls to set_pglocale_pgservice(). > Generally speaking I find the 'progname' handling a bit silly (since we > have it both as a variable in each program and also in

Re: Plug-in common/logging.h with vacuumlo and oid2name

2019-09-05 Thread Alvaro Herrera
Patch looks good to me, please push. Generally speaking I find the 'progname' handling a bit silly (since we have it both as a variable in each program and also in logging.c separately), but that's not the fault of this patch, and this patch doesn't make it worse. That said, I think some other me

Re: Plug-in common/logging.h with vacuumlo and oid2name

2019-09-05 Thread Peter Eisentraut
On 2019-09-05 01:59, Michael Paquier wrote: > On Wed, Sep 04, 2019 at 02:37:12PM +0200, Peter Eisentraut wrote: Do we need set_pglocale_pgservice() calls here if we're not doing NLS? Does the logging stuff require it? I'm not sure. >>> >>> The logging part does not require it, but this c

Re: Plug-in common/logging.h with vacuumlo and oid2name

2019-09-05 Thread Michael Paquier
On Thu, Sep 05, 2019 at 08:59:41AM +0900, Michael Paquier wrote: > There is an argument to allow libpq to find out a service file for > a connection from the executable path. Note that oid2name can use a > connection string for connection, but not vacuumlo, so I somewhat > missed that. If you thi

Re: Plug-in common/logging.h with vacuumlo and oid2name

2019-09-04 Thread Michael Paquier
On Wed, Sep 04, 2019 at 02:37:12PM +0200, Peter Eisentraut wrote: >>> Do we need set_pglocale_pgservice() calls here if we're not doing NLS? >>> Does the logging stuff require it? I'm not sure. >> >> The logging part does not require it, but this can be used for >> PGSYSCONFDIR, no? > > How does

Re: Plug-in common/logging.h with vacuumlo and oid2name

2019-09-04 Thread Peter Eisentraut
On 2019-09-04 14:17, Michael Paquier wrote: >> progname can probably be made into a local variable now. > > Can it? vacuumlo() still uses the progname from _param for the > connection string. Yeah, probably best to leave it as is for now. >> Do we need set_pglocale_pgservice() calls here if we'

Re: Plug-in common/logging.h with vacuumlo and oid2name

2019-09-04 Thread Michael Paquier
On Wed, Sep 04, 2019 at 10:17:57AM +0200, Peter Eisentraut wrote: > On 2019-08-20 03:28, Michael Paquier wrote: > > + pg_log_error("\nfailed to remove lo %u: > > %s", lo, > > + > > PQerrorMessage(conn));

Re: Plug-in common/logging.h with vacuumlo and oid2name

2019-09-04 Thread Peter Eisentraut
On 2019-08-20 03:28, Michael Paquier wrote: > + pg_log_error("\nfailed to remove lo %u: > %s", lo, > + > PQerrorMessage(conn)); This newline should be removed. progname can probably be made into a l