On Fri, Mar 1, 2024, at 8:07 PM, Tomas Vondra wrote:
> On 3/1/24 23:41, Nathan Bossart wrote:
> > 
> > I think this is a generally reasonable proposal, except I don't know
> > whether this breakage is acceptable.  AFAICT there are two fundamental
> > behavior changes folks would observe:
> > 
> > * "-d <database_name>" would cease to emit the debugging output, and while
> >   enabling debug mode might've been unintentional in most cases, it might
> >   actually have been intentional in others.
> > 
> 
> I think this is the more severe of the two issues, because it's a silent
> change. Everything will seem to work, but the user won't get the debug
> info (if they actually wanted it).

Indeed. Hopefully the user will notice soon when inspecting the standard error
output.

> > * "-d" with no argument or with a following option would begin failing, and
> >   users would need to replace "-d" with "--debug".
> > 
> 
> I think this is fine.

Yeah. It will force the user to fix it immediately.

> > Neither of these seems particularly severe to me, especially for a
> > benchmarking program, but I'd be curious to hear what others think.
> > 
> 
> I agree the -d option may be confusing, but is it worth it? I don't
> know, it depends on how often people actually get confused by it, and I
> don't recall hitting this (nor hearing about others). To be honest I
> didn't even realize pgbench even has a debug switch ...

I'm the one that has a habit to use -d to specify the database name. I
generally include -d for pgbench and then realized that I don't need the debug
information because it is not for database specification.

> But I'd like to mention this is far from our only tool using "-d" to
> enable debug mode. A quick git-grep shows postgres, initdb,
> pg_archivecleanup and pg_combinebackup do the same thing. So maybe it's
> not that inconsistent overall.

As Greg said none of these programs connects to the database.

I don't like to break backward compatibility but in this case I suspect that it
is ok. I don't recall the last time I saw a script that makes use of -d option.
How often do you need a pgbench debug information?


--
Euler Taveira
EDB   https://www.enterprisedb.com/

Reply via email to