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

Поиск
Список
Период
Сортировка
Искать
От
Daniel Gustafsson
Тема
Re: Allow default \watch interval in psql to be configured
Дата
Msg-id
FC0C250D-8C47-4A42-B262-2FDCA5B47590@yesql.se
Список
Дерево обсуждения
Re: Allow default \watch interval in psql to be configured Daniel Gustafsson <daniel@yesql.se>
Re: Allow default \watch interval in psql to be configured Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Re: Allow default \watch interval in psql to be configured Daniel Gustafsson <daniel@yesql.se>
Re: Allow default \watch interval in psql to be configured Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Re: Allow default \watch interval in psql to be configured Daniel Gustafsson <daniel@yesql.se>
Re: Allow default \watch interval in psql to be configured Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Re: Allow default \watch interval in psql to be configured Daniel Gustafsson <daniel@yesql.se>
Re: Allow default \watch interval in psql to be configured Pavel Stehule <pavel.stehule@gmail.com>
Re: Allow default \watch interval in psql to be configured Pavel Stehule <pavel.stehule@gmail.com>
Re: Allow default \watch interval in psql to be configured Daniel Gustafsson <daniel@yesql.se>
Re: Allow default \watch interval in psql to be configured Pavel Stehule <pavel.stehule@gmail.com>
Re: Allow default \watch interval in psql to be configured Daniel Gustafsson <daniel@yesql.se>
Re: Allow default \watch interval in psql to be configured Ranier Vilela <ranier.vf@gmail.com>
Re: Allow default \watch interval in psql to be configured Daniel Gustafsson <daniel@yesql.se>
Re: Allow default \watch interval in psql to be configured Pavel Stehule <pavel.stehule@gmail.com>
Re: Allow default \watch interval in psql to be configured Greg Sabino Mullane <htamfids@gmail.com>
Re: Allow default \watch interval in psql to be configured Greg Sabino Mullane <htamfids@gmail.com>
Re: Allow default \watch interval in psql to be configured Michael Paquier <michael@paquier.xyz>
> On 10 Oct 2024, at 02:01, Michael Paquier  wrote:
> 
> On Wed, Oct 09, 2024 at 04:24:27PM +0200, Daniel Gustafsson wrote:
>> Fixed.
> 
> -        double        sleep = 2;
> +        double        sleep = pset.watch_interval;
> 
> This forces the use of seconds as unit.  The interval values I have
> been using a lot myself are between 0.2s and 0.5s because I usually
> want a lot more granularity in my lookups than the 1s interval.  Could 
> it be better to allow values lower than 1s or let this value be a
> string with optional "s" or "ms" units?

I'm not sure I follow, it's true that the unit is seconds but the patch doesn't
change the ability to use fractions of a second that we already support today.

db=# \echo :WATCH_INTERVAL
2
db=# \set WATCH_INTERVAL 0.1
db=# \echo :WATCH_INTERVAL
0.1
db=# select 1;
 ?column?
----------
        1
(1 row)

danielg=# \watch
Thu Oct 10 09:32:05 2024 (every 0.1s)

 ?column?
----------
        1
(1 row)

Thu Oct 10 09:32:05 2024 (every 0.1s)

 ?column?
----------
        1
(1 row)

Or did I misunderstand your email?

We could support passing in an optional unit, and assume the unit to be seconds
if none was used, but it doesn't really fit nicely with the current API we have
so I wonder if the added complexity is worth it?

--
Daniel Gustafsson



В списке pgsql-hackers по дате отправления
От: Daniel Gustafsson
Дата:
От: Richard Guo
Дата:
FAQ