The first failed connection tests the "regular" connections limit, not
the reserved limit.
In the second failed connection, the username doesn't really matter,
but since the previous successful connections used "regress_reserved",
it seems weird to switch back to "regress_regular" for the
expected-to-fail attempt.
Discussion: https://www.postgresql.org/message-id/
fd5e9523-78d3-4270-86b2-
fd1b1eeb4fc9@iki.fi
connect_fails_wait(
$node,
"dbname=postgres user=regress_regular",
- "reserved_connections limit",
+ "regular connections limit",
expected_stderr =>
qr/FATAL: remaining connection slots are reserved for roles with privileges of the "pg_use_reserved_connections" role/
);
push(@sessions, background_psql_as_user('regress_reserved'));
connect_fails_wait(
$node,
- "dbname=postgres user=regress_regular",
+ "dbname=postgres user=regress_reserved",
"reserved_connections limit",
expected_stderr =>
qr/FATAL: remaining connection slots are reserved for roles with the SUPERUSER attribute/