pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: psql: Fix \watch when using interval values less than 1ms
3+ messages / 1 participants
[nested] [flat]

* pgsql: psql: Fix \watch when using interval values less than 1ms
@ 2024-10-14 03:28  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael Paquier @ 2024-10-14 03:28 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Fix \watch when using interval values less than 1ms

Attempting to use an interval of time less than 1ms would cause \watch
to hang.  This was confusing, so let's change the logic so as an
interval lower than 1ms behaves the same as 0.

Comments are added to mention that the internals of do_watch() had
better rely on "sleep_ms", the interval value in milliseconds.  While on
it, this commit adds a test to check the behavior of interval values
less than 1ms.

\watch hanging for interval values less than 1ms existed before
6f9ee74d45aa, that has changed the code to support an interval value of
0.

Reported-by: Heikki Linnakangas
Author: Andrey M. Borodin, Michael Paquier
Discussion: https://postgr.es/m/88445e0e-3156-4b9d-afae-9a1a7b1631f6@iki.fi
Backpatch-through: 16

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6331972c7bc9897780ed9a7ff2320e5c85052a69

Modified Files
--------------
src/bin/psql/command.c      | 11 ++++++++---
src/bin/psql/t/001_basic.pl | 10 ++++++++--
2 files changed, 16 insertions(+), 5 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: psql: Fix \watch when using interval values less than 1ms
@ 2024-10-14 03:28  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael Paquier @ 2024-10-14 03:28 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Fix \watch when using interval values less than 1ms

Attempting to use an interval of time less than 1ms would cause \watch
to hang.  This was confusing, so let's change the logic so as an
interval lower than 1ms behaves the same as 0.

Comments are added to mention that the internals of do_watch() had
better rely on "sleep_ms", the interval value in milliseconds.  While on
it, this commit adds a test to check the behavior of interval values
less than 1ms.

\watch hanging for interval values less than 1ms existed before
6f9ee74d45aa, that has changed the code to support an interval value of
0.

Reported-by: Heikki Linnakangas
Author: Andrey M. Borodin, Michael Paquier
Discussion: https://postgr.es/m/88445e0e-3156-4b9d-afae-9a1a7b1631f6@iki.fi
Backpatch-through: 16

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8a6170860c83d3f44b7d97193a2c23539c24f76d

Modified Files
--------------
src/bin/psql/command.c      | 11 ++++++++---
src/bin/psql/t/001_basic.pl | 10 ++++++++--
2 files changed, 16 insertions(+), 5 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* pgsql: psql: Fix \watch when using interval values less than 1ms
@ 2024-10-14 03:28  Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael Paquier @ 2024-10-14 03:28 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

psql: Fix \watch when using interval values less than 1ms

Attempting to use an interval of time less than 1ms would cause \watch
to hang.  This was confusing, so let's change the logic so as an
interval lower than 1ms behaves the same as 0.

Comments are added to mention that the internals of do_watch() had
better rely on "sleep_ms", the interval value in milliseconds.  While on
it, this commit adds a test to check the behavior of interval values
less than 1ms.

\watch hanging for interval values less than 1ms existed before
6f9ee74d45aa, that has changed the code to support an interval value of
0.

Reported-by: Heikki Linnakangas
Author: Andrey M. Borodin, Michael Paquier
Discussion: https://postgr.es/m/88445e0e-3156-4b9d-afae-9a1a7b1631f6@iki.fi
Backpatch-through: 16

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9f34cae1426fe5ab915c95b7e26b1efffbb2ca0f

Modified Files
--------------
src/bin/psql/command.c      | 11 ++++++++---
src/bin/psql/t/001_basic.pl | 10 ++++++++--
2 files changed, 16 insertions(+), 5 deletions(-)



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2024-10-14 03:28 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-10-14 03:28 pgsql: psql: Fix \watch when using interval values less than 1ms Michael Paquier <michael@paquier.xyz>
2024-10-14 03:28 pgsql: psql: Fix \watch when using interval values less than 1ms Michael Paquier <michael@paquier.xyz>
2024-10-14 03:28 pgsql: psql: Fix \watch when using interval values less than 1ms Michael Paquier <michael@paquier.xyz>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox