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

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, 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-26 07:42:44
Message-ID: CAFj8pRAjjk4yuXMi-uUbAwmrBygwQT6Bwuy=UZu8JqCebzvetQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

st 26. 3. 2025 v 7:59 odesílatel Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
napsal:

> Hi
>
> út 25. 3. 2025 v 20:09 odesílatel Daniel Gustafsson <daniel(at)yesql(dot)se>
> napsal:
>
>> > On 24 Mar 2025, at 13:42, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
>> wrote:
>>
>> > LGTM. I think this is RFC. Updated CF entry.
>>
>> Thanks all for review, committed.
>>
>>
> regress tests fails now in my
>
> make[2]: Vstupuje se do adresáře „/home/pavel/src/postgresql/src/bin/psql“
> echo "# +++ tap check in src/bin/psql +++" && rm -rf
> '/home/pavel/src/postgresql/src/bin/psql'/tmp_check && /usr/bin/mkdir -p
> '/home/pavel/src/postgresql/src/bin/psql'/tmp_check && cd . &&
> TESTLOGDIR='/home/pavel/src/postgresql/src/bin/psql/tmp_check/log'
> TESTDATADIR='/home/pavel/src/postgresql/src/bin/psql/tmp_check'
> PATH="/home/pavel/src/postgresql/tmp_install/usr/local/pgsql/master/bin:/home/pavel/src/postgresql/src/bin/psql:$PATH"
> LD_LIBRARY_PATH="/home/pavel/src/postgresql/tmp_install/usr/local/pgsql/master/lib"
> INITDB_TEMPLATE='/home/pavel/src/postgresql'/tmp_install/initdb-template
> PGPORT='65432'
> top_builddir='/home/pavel/src/postgresql/src/bin/psql/../../..'
> PG_REGRESS='/home/pavel/src/postgresql/src/bin/psql/../../../src/test/regress/pg_regress'
> share_contrib_dir='/home/pavel/src/postgresql/tmp_install/usr/local/pgsql/master/share/'
> /usr/bin/prove -I ../../../src/test/perl/ -I . t/*.pl
> # +++ tap check in src/bin/psql +++
> t/001_basic.pl ........... 46/?
> # Failed test 'WATCH_INTERVAL variable is set and updated: exit code 0'
> # at t/001_basic.pl line 436.
> # got: '3'
> # expected: '0'
>
> # Failed test 'WATCH_INTERVAL variable is set and updated: no stderr'
> # at t/001_basic.pl line 436.
> # got: 'psql:<stdin>:2: error: "0.001" is out of range for
> "WATCH_INTERVAL"'
> # expected: ''
>
> # Failed test 'WATCH_INTERVAL variable is set and updated: matches'
> # at t/001_basic.pl line 436.
> # '2'
> # doesn't match '(?^lm:^2$
> # ^0.001$
> # ^2$)'
> # Looks like you failed 3 tests of 116.
> t/001_basic.pl ........... Dubious, test returned 3 (wstat 768, 0x300)
> Failed 3/116 subtests
> t/010_tab_completion.pl .. ok
> t/020_cancel.pl .......... ok
>
> Test Summary Report
> -------------------
> t/001_basic.pl (Wstat: 768 (exited 3) Tests: 116 Failed: 3)
> Failed tests: 95-97
> Non-zero exit status: 3
> Files=3, Tests=207, 7 wallclock secs ( 0.12 usr 0.02 sys + 3.38 cusr
> 1.72 csys = 5.24 CPU)
> Result: FAIL
>
> The reason is probably my LANG=cs_CZ.UTF8. When I switched to LANG=C, then
> tests passed.
>

The main problem is in numeric format. Czech uses the comma instead of the
dot.

pavel(at)nemesis:~/src/postgresql/src/bin/psql$ LANG=C psql -c "\set
WATCH_INTERVAL 0.001"
pavel(at)nemesis:~/src/postgresql/src/bin/psql$ LANG=cs_CZ.UTF8 psql -c "\set
WATCH_INTERVAL 0.001"
"0.001" is out of range for "WATCH_INTERVAL"
pavel(at)nemesis:~/src/postgresql/src/bin/psql$ LANG=cs_CZ.UTF8 psql -c "\set
WATCH_INTERVAL 0,001"

Regards

Pavel

> Regards
>
> Pavel
>
>
>> --
>> Daniel Gustafsson
>>
>>
>>
>>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2025-03-26 07:47:36 RE: Fix 035_standby_logical_decoding.pl race conditions
Previous Message Steven Niu 2025-03-26 07:17:15 [PATCH] avoid double scanning in function byteain