pgsql: Make psql/t/030_pager.pl more robust.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Make psql/t/030_pager.pl more robust.
Date: 2026-01-30 20:11:54
Message-ID: E1vluqP-000DDF-1m@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Make psql/t/030_pager.pl more robust.

Similarly to the preceding commit, 030_pager.pl was assuming
that patterns it looks for in interactive psql output would
appear by themselves on a line, but that assumption tends to
fall over in builds made --without-readline: the output we
get might have a psql prompt immediately followed by the
expected line of output.

For several of these tests, just checking for the pattern
followed by newline seems sufficient, because we could not
get a false match against the command echo, nor against the
unreplaced command output if the pager fails to be invoked
when expected. However, that's fairly scary for the test
that was relying on information_schema.referential_constraints:
"\d+" could easily appear at the end of a line in that view.
Let's get rid of that hazard by making a custom test view
instead of using information_schema.referential_constraints.

This test script is new in v19, so no need for back-patch.

Reported-by: Oleg Tselebrovskiy <o(dot)tselebrovskiy(at)postgrespro(dot)ru>
Author: Oleg Tselebrovskiy <o(dot)tselebrovskiy(at)postgrespro(dot)ru>
Co-authored-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Reviewed-by: Soumya S Murali <soumyamurali(dot)work(at)gmail(dot)com>
Discussion: https://postgr.es/m/db6fdb35a8665ad3c18be01181d44b31@postgrespro.ru

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6918434a4acb2b14535b3c1be30d306666db7c24

Modified Files
--------------
src/bin/psql/t/030_pager.pl | 43 ++++++++++++++++++++++++++++++++++++++-----
1 file changed, 38 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2026-02-01 23:04:53 pgsql: Fix build inconsistency due to the generation of wait-event code
Previous Message Heikki Linnakangas 2026-01-30 16:27:04 pgsql: Move shmem allocator's fields from PGShmemHeader to its own stru