diff -U3 /tmp/cirrus-ci-build/contrib/postgres_fdw/expected/postgres_fdw.out /tmp/cirrus-ci-build/contrib/postgres_fdw/results/postgres_fdw.out --- /tmp/cirrus-ci-build/contrib/postgres_fdw/expected/postgres_fdw.out 2026-03-09 20:33:43.408333732 +0000 +++ /tmp/cirrus-ci-build/contrib/postgres_fdw/results/postgres_fdw.out 2026-03-09 20:40:52.208078448 +0000 @@ -12429,312 +12429,8 @@ (11 rows) SELECT a FROM base_tbl WHERE (a, random() > 0) IN (SELECT a, random() > 0 FROM foreign_tbl); - a ---- - 1 - 2 - 3 -(3 rows) - --- Clean up -DROP FOREIGN TABLE foreign_tbl CASCADE; -NOTICE: drop cascades to foreign table foreign_tbl2 -DROP TABLE base_tbl; -ALTER SERVER loopback OPTIONS (DROP async_capable); -ALTER SERVER loopback2 OPTIONS (DROP async_capable); --- =================================================================== --- test invalid server, foreign table and foreign data wrapper options --- =================================================================== --- Invalid fdw_startup_cost option -CREATE SERVER inv_scst FOREIGN DATA WRAPPER postgres_fdw - OPTIONS(fdw_startup_cost '100$%$#$#'); -ERROR: invalid value for floating point option "fdw_startup_cost": 100$%$#$# --- Invalid fdw_tuple_cost option -CREATE SERVER inv_scst FOREIGN DATA WRAPPER postgres_fdw - OPTIONS(fdw_tuple_cost '100$%$#$#'); -ERROR: invalid value for floating point option "fdw_tuple_cost": 100$%$#$# --- Invalid fetch_size option -CREATE FOREIGN TABLE inv_fsz (c1 int ) - SERVER loopback OPTIONS (fetch_size '100$%$#$#'); -ERROR: invalid value for integer option "fetch_size": 100$%$#$# --- Invalid batch_size option -CREATE FOREIGN TABLE inv_bsz (c1 int ) - SERVER loopback OPTIONS (batch_size '100$%$#$#'); -ERROR: invalid value for integer option "batch_size": 100$%$#$# --- No option is allowed to be specified at foreign data wrapper level -ALTER FOREIGN DATA WRAPPER postgres_fdw OPTIONS (nonexistent 'fdw'); -ERROR: invalid option "nonexistent" -HINT: There are no valid options in this context. --- =================================================================== --- test postgres_fdw.application_name GUC --- =================================================================== --- To avoid race conditions in checking the remote session's application_name, --- use this view to make the remote session itself read its application_name. -CREATE VIEW my_application_name AS - SELECT application_name FROM pg_stat_activity WHERE pid = pg_backend_pid(); -CREATE FOREIGN TABLE remote_application_name (application_name text) - SERVER loopback2 - OPTIONS (schema_name 'public', table_name 'my_application_name'); -SELECT count(*) FROM remote_application_name; - count -------- - 1 -(1 row) - --- Specify escape sequences in application_name option of a server --- object so as to test that they are replaced with status information --- expectedly. Note that we are also relying on ALTER SERVER to force --- the remote session to be restarted with its new application name. --- --- Since pg_stat_activity.application_name may be truncated to less than --- NAMEDATALEN characters, note that substring() needs to be used --- at the condition of test query to make sure that the string consisting --- of database name and process ID is also less than that. -ALTER SERVER loopback2 OPTIONS (application_name 'fdw_%d%p'); -SELECT count(*) FROM remote_application_name - WHERE application_name = - substring('fdw_' || current_database() || pg_backend_pid() for - current_setting('max_identifier_length')::int); - count -------- - 1 -(1 row) - --- postgres_fdw.application_name overrides application_name option --- of a server object if both settings are present. -ALTER SERVER loopback2 OPTIONS (SET application_name 'fdw_wrong'); -SET postgres_fdw.application_name TO 'fdw_%a%u%%'; -SELECT count(*) FROM remote_application_name - WHERE application_name = - substring('fdw_' || current_setting('application_name') || - CURRENT_USER || '%' for current_setting('max_identifier_length')::int); - count -------- - 1 -(1 row) - -RESET postgres_fdw.application_name; --- Test %c (session ID) and %C (cluster name) escape sequences. -ALTER SERVER loopback2 OPTIONS (SET application_name 'fdw_%C%c'); -SELECT count(*) FROM remote_application_name - WHERE application_name = - substring('fdw_' || current_setting('cluster_name') || - to_hex(trunc(EXTRACT(EPOCH FROM (SELECT backend_start FROM - pg_stat_get_activity(pg_backend_pid()))))::integer) || '.' || - to_hex(pg_backend_pid()) - for current_setting('max_identifier_length')::int); - count -------- - 1 -(1 row) - --- Clean up. -DROP FOREIGN TABLE remote_application_name; -DROP VIEW my_application_name; --- =================================================================== --- test parallel commit and parallel abort --- =================================================================== -ALTER SERVER loopback OPTIONS (ADD parallel_commit 'true'); -ALTER SERVER loopback OPTIONS (ADD parallel_abort 'true'); -ALTER SERVER loopback2 OPTIONS (ADD parallel_commit 'true'); -ALTER SERVER loopback2 OPTIONS (ADD parallel_abort 'true'); -CREATE TABLE ploc1 (f1 int, f2 text); -CREATE FOREIGN TABLE prem1 (f1 int, f2 text) - SERVER loopback OPTIONS (table_name 'ploc1'); -CREATE TABLE ploc2 (f1 int, f2 text); -CREATE FOREIGN TABLE prem2 (f1 int, f2 text) - SERVER loopback2 OPTIONS (table_name 'ploc2'); -BEGIN; -INSERT INTO prem1 VALUES (101, 'foo'); -INSERT INTO prem2 VALUES (201, 'bar'); -COMMIT; -SELECT * FROM prem1; - f1 | f2 ------+----- - 101 | foo -(1 row) - -SELECT * FROM prem2; - f1 | f2 ------+----- - 201 | bar -(1 row) - -BEGIN; -SAVEPOINT s; -INSERT INTO prem1 VALUES (102, 'foofoo'); -INSERT INTO prem2 VALUES (202, 'barbar'); -RELEASE SAVEPOINT s; -COMMIT; -SELECT * FROM prem1; - f1 | f2 ------+-------- - 101 | foo - 102 | foofoo -(2 rows) - -SELECT * FROM prem2; - f1 | f2 ------+-------- - 201 | bar - 202 | barbar -(2 rows) - --- This tests executing DEALLOCATE ALL against foreign servers in parallel --- during pre-commit -BEGIN; -SAVEPOINT s; -INSERT INTO prem1 VALUES (103, 'baz'); -INSERT INTO prem2 VALUES (203, 'qux'); -ROLLBACK TO SAVEPOINT s; -RELEASE SAVEPOINT s; -INSERT INTO prem1 VALUES (104, 'bazbaz'); -INSERT INTO prem2 VALUES (204, 'quxqux'); -COMMIT; -SELECT * FROM prem1; - f1 | f2 ------+-------- - 101 | foo - 102 | foofoo - 104 | bazbaz -(3 rows) - -SELECT * FROM prem2; - f1 | f2 ------+-------- - 201 | bar - 202 | barbar - 204 | quxqux -(3 rows) - -BEGIN; -INSERT INTO prem1 VALUES (105, 'test1'); -INSERT INTO prem2 VALUES (205, 'test2'); -ABORT; -SELECT * FROM prem1; - f1 | f2 ------+-------- - 101 | foo - 102 | foofoo - 104 | bazbaz -(3 rows) - -SELECT * FROM prem2; - f1 | f2 ------+-------- - 201 | bar - 202 | barbar - 204 | quxqux -(3 rows) - --- This tests executing DEALLOCATE ALL against foreign servers in parallel --- during post-abort -BEGIN; -SAVEPOINT s; -INSERT INTO prem1 VALUES (105, 'test1'); -INSERT INTO prem2 VALUES (205, 'test2'); -ROLLBACK TO SAVEPOINT s; -RELEASE SAVEPOINT s; -INSERT INTO prem1 VALUES (105, 'test1'); -INSERT INTO prem2 VALUES (205, 'test2'); -ABORT; -SELECT * FROM prem1; - f1 | f2 ------+-------- - 101 | foo - 102 | foofoo - 104 | bazbaz -(3 rows) - -SELECT * FROM prem2; - f1 | f2 ------+-------- - 201 | bar - 202 | barbar - 204 | quxqux -(3 rows) - -ALTER SERVER loopback OPTIONS (DROP parallel_commit); -ALTER SERVER loopback OPTIONS (DROP parallel_abort); -ALTER SERVER loopback2 OPTIONS (DROP parallel_commit); -ALTER SERVER loopback2 OPTIONS (DROP parallel_abort); --- =================================================================== --- test for ANALYZE sampling --- =================================================================== -CREATE TABLE analyze_table (id int, a text, b bigint); -CREATE FOREIGN TABLE analyze_ftable (id int, a text, b bigint) - SERVER loopback OPTIONS (table_name 'analyze_table'); -INSERT INTO analyze_table (SELECT x FROM generate_series(1,1000) x); -ANALYZE analyze_table; -SET default_statistics_target = 10; -ANALYZE analyze_table; -ALTER SERVER loopback OPTIONS (analyze_sampling 'invalid'); -ERROR: invalid value for string option "analyze_sampling": invalid -ALTER SERVER loopback OPTIONS (analyze_sampling 'auto'); -ANALYZE analyze_ftable; -ALTER SERVER loopback OPTIONS (SET analyze_sampling 'system'); -ANALYZE analyze_ftable; -ALTER SERVER loopback OPTIONS (SET analyze_sampling 'bernoulli'); -ANALYZE analyze_ftable; -ALTER SERVER loopback OPTIONS (SET analyze_sampling 'random'); -ANALYZE analyze_ftable; -ALTER SERVER loopback OPTIONS (SET analyze_sampling 'off'); -ANALYZE analyze_ftable; --- cleanup -DROP FOREIGN TABLE analyze_ftable; -DROP TABLE analyze_table; --- =================================================================== --- test for postgres_fdw_get_connections function with check_conn = true --- =================================================================== --- Disable debug_discard_caches in order to manage remote connections -SET debug_discard_caches TO '0'; --- The text of the error might vary across platforms, so only show SQLSTATE. -\set VERBOSITY sqlstate -SELECT 1 FROM postgres_fdw_disconnect_all(); - ?column? ----------- - 1 -(1 row) - -ALTER SERVER loopback OPTIONS (SET application_name 'fdw_conn_check'); -SELECT 1 FROM ft1 LIMIT 1; - ?column? ----------- - 1 -(1 row) - --- Since the remote server is still connected, "closed" should be FALSE, --- or NULL if the connection status check is not available. --- In this test, the remote backend handling this connection should have --- application_name set to "fdw_conn_check", so remote_backend_pid should --- match the PID from the pg_stat_activity entry with that application_name. -SELECT server_name, - CASE WHEN closed IS NOT true THEN false ELSE true END AS closed, - remote_backend_pid = (SELECT pid FROM pg_stat_activity - WHERE application_name = 'fdw_conn_check') AS remote_backend_pid - FROM postgres_fdw_get_connections(true); - server_name | closed | remote_backend_pid --------------+--------+-------------------- - loopback | f | t -(1 row) - --- After terminating the remote backend, since the connection is closed, --- "closed" should be TRUE, or NULL if the connection status check --- is not available. Despite the termination, remote_backend_pid should --- still show the non-zero PID of the terminated remote backend. -DO $$ BEGIN -PERFORM pg_terminate_backend(pid, 180000) FROM pg_stat_activity - WHERE application_name = 'fdw_conn_check'; -END $$; -SELECT server_name, - CASE WHEN closed IS NOT false THEN true ELSE false END AS closed, - remote_backend_pid <> 0 AS remote_backend_pid - FROM postgres_fdw_get_connections(true); - server_name | closed | remote_backend_pid --------------+--------+-------------------- - loopback | t | t -(1 row) - --- Clean up -\set VERBOSITY default -RESET debug_discard_caches; +FATAL: fatal llvm error: Broken module found, compilation aborted! +server closed the connection unexpectedly + This probably means the server terminated abnormally + before or while processing the request. +connection to server was lost