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

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Kirill Reshke <reshkekirill(at)gmail(dot)com>
Cc: 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: 2024-11-13 16:48:49
Message-ID: E9D850C4-52A3-4D63-B71A-8EA5F00FCA27@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 4 Nov 2024, at 14:55, Kirill Reshke <reshkekirill(at)gmail(dot)com> wrote:

> I'm mostly fine with this patch,

Thanks for review!

> but maybe we need to handle `errno ==
> ERANGE` inside ParseVariableDouble and provide a better error msg in
> this case?
> Something like:
> ```
> reshke=# \set WATCH_INTERVAL -1e-309
> underflow while parsing parameter
> ```

Fair point, I've added ERANGE handling in the attached v3.

> Also, maybe we should provide `double max` arg to the
> ParseVariableDouble function, because this is a general-use function?

It's general use, but not generally used. Since it's not an exposed API it
seems premature to add handling of a max value when there is no need, once
there is a caller (if one ever comes) that needs it we can deal with it at that
point.

--
Daniel Gustafsson

Attachment Content-Type Size
v3-0001-Make-default-watch-interval-configurable.patch application/octet-stream 6.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Emanuele Musella 2024-11-13 16:54:56 Re: Parametrization minimum password lenght
Previous Message Dmitry Dolgov 2024-11-13 16:34:59 Re: proposal: schema variables