Re: Allow default \watch interval in psql to be configured

From: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Greg Sabino Mullane <htamfids(at)gmail(dot)com>, Masahiro Ikeda <ikedamsh(at)oss(dot)nttdata(dot)com>, Kirill Reshke <reshkekirill(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Allow default \watch interval in psql to be configured
Date: 2025-03-24 12:42:29
Message-ID: CAExHW5skFkifyb+yJf=D-7gtXZ7hFHnmdSOVufO99uS0Sz22Cg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 24, 2025 at 5:40 PM Daniel Gustafsson <daniel(at)yesql(dot)se> wrote:

>
> > With this patch, we are doing something unprecedented (at least
> > AFAIK); allowing command arguments defaults to be configurable through
> > a psql variable (as against an environment variable). I admit that
> > configurable through a psql variable is better since it doesn't meddle
> > with environment. Glancing through psql documentation, I didn't find a
> > lot of command which may need default argument to be configurable.
> > Nonetheless we should mention why this is special and set some
> > guidance for such future additions - preferrably in code or at least
> > in the commit message.
>
> Sure, I'll mention it in the commit message.
>
> > - of rows. Wait the specified number of seconds (default 2) between executions.
> > - For backwards compatibility,
> > + of rows. Wait the specified number of seconds (defaults to 2 if
> > omitted, which can be
> > + changed with the variable <xref linkend="app-psql-variables-watch-interval"/>)
> > + between executions. For backwards compatibility,
> >
> > The text in parenthesis is quite long and it's hard to read ...
> > seconds between execution. I suggest
> > "Wait the specified number of seconds (default 2) between executions.
> > The default wait can be changed by setting the variable <xref
> > linkend="app-psql-variables-watch-interval"/>."
>
> Fixed.
>
> > + " number of seconds \\watch waits between executing the query buffer\n");
> >
> > I am feeling that this should mention "default" somewhere - maybe just
> > add it before "number of ".
>
> Fixed.

LGTM. I think this is RFC. Updated CF entry.

--
Best Wishes,
Ashutosh Bapat

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alena Rybakina 2025-03-24 12:46:03 Re: POC, WIP: OR-clause support for indexes
Previous Message Nazir Bilal Yavuz 2025-03-24 12:40:05 Re: Add pg_buffercache_evict_all() and pg_buffercache_mark_dirty[_all]() functions