]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Make plpgsql_trap test more robust and less resource-intensive.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 21 Apr 2026 14:54:39 +0000 (10:54 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 21 Apr 2026 14:54:39 +0000 (10:54 -0400)
commit94f1409847e0eb9c6eaaefe3366e53b19641ccfe
treea9e850529857a5fdf22320c79b9aa553ce44e1de
parent9d6208939a0ad05171e37a106f02c55a591a26f1
Make plpgsql_trap test more robust and less resource-intensive.

We were using "select count(*) into x from generate_series(1,
1_000_000_000_000)" to waste one second waiting for a statement
timeout trap.  Aside from consuming CPU to little purpose, this could
easily eat several hundred MB of temporary file space, which has been
observed to cause out-of-disk-space errors in the buildfarm.
Let's just use "pg_sleep(10)", which is far less resource-intensive.

Also update the "when others" exception handler so that if it does
ever again trap an error, it will tell us what error.  The cause of
these intermittent buildfarm failures had been obscure for awhile.

Discussion: https://postgr.es/m/557992.1776779694@sss.pgh.pa.us
Backpatch-through: 14
src/pl/plpgsql/src/expected/plpgsql_trap.out
src/pl/plpgsql/src/sql/plpgsql_trap.sql