Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sTk0g-001wgv-0a for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Jul 2024 15:22:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sTk0e-001hlK-Le for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Jul 2024 15:22:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sTk0e-001hlA-4Q for pgsql-hackers@lists.postgresql.org; Tue, 16 Jul 2024 15:22:32 +0000 Received: from fout1-smtp.messagingengine.com ([103.168.172.144]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sTk0a-002MKD-NQ for pgsql-hackers@lists.postgresql.org; Tue, 16 Jul 2024 15:22:30 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfout.nyi.internal (Postfix) with ESMTP id DA1C11388C9F; Tue, 16 Jul 2024 11:22:27 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 16 Jul 2024 11:22:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1721143347; x= 1721229747; bh=XsxusnEI3WbwKA1nAiV7iKlVFJjPuntw5M8xBGJo1Ws=; b=V e6gG3XKz/rJQn8Q/0bIGsy0+ucKR3X3DFUAJmqathEoZZ89x2HS2qv9/b16fNWWr HgCOkOKlXjk/D+NlUEHniubXT37L093gaIlJHJCaVai1aU8df5I5Pk23OqO9OpjW djflxt35NRFKwC1U0ky7a5uMadSHaeup/x0sEPTMxPD0mMusqW0QAMI7Zd68VgCn NM3RYfHGg42JpVazzPpG7Ud1vhcj2JcX4HIQfItv1Wt/YE5pVo6unW99KAmcRqRo s1Yi2MzX3Y++sVZUqutFuvWx1PHoJhdcFue6Sczlx9y6vcC74HkktifZg7ey19Hu UnMQt+wDY93tuxBAcvgpQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrgeeggdekiecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehmkeerredttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeduleekkefgtddttedtkefguddvieffleetgeejiefhteeh keevfeettdduvdfhueenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 16 Jul 2024 11:22:26 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1721143345; bh=jpJs/KcMHd9Tuc+dXbH1ZWAnPm9Z0zsB86xOrH12vNs=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=afRn6ZyRju6gWPYzWaDPgh+sz7xNl3r+T/E3XkyfqNzlYUYWBOTpqwSpEnSqXkUEh xCwJdy6cu/nVutQI4Lkg/hqmk5JHmFXOFzSx/OcatCJFoZLRDoEH7m2IzT2Vsw8ysU UbE0vaJZ+/eY+xJEBu8XQ/+pVxngAIoxnZUsqcm15cNLfsr7pczSDHZvZMyeeslv6x hFdvWC1mJokxiksztbaGUqaPZuttPM+RA0tBLoi52v8HAW+eTYLTUQrrWuh90s5CcU DuNEPu6KJQf6Rhmfq7CMbMELK6QflA3TmaxPVPiJe+RmFudAWNLfwwievHaDZ6KKCC +vpz2pF1XEHzQ== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 33603129; Tue, 16 Jul 2024 17:22:25 +0200 (CEST) Date: Tue, 16 Jul 2024 17:22:25 +0200 From: Alvaro Herrera To: Alexander Lakhin Cc: Jelte Fennema-Nio , Noah Misch , Tom Lane , Jacob Champion , Denis Laxalde , vignesh C , Thomas Munro , Greg Stark , "Gregory Stark (as CFM)" , Jelte Fennema , Daniel Gustafsson , Peter Eisentraut , Andres Freund , Justin Pryzby , Robert Haas , pgsql-hackers@lists.postgresql.org, Etsuro Fujita Subject: Re: [EXTERNAL] Re: Add non-blocking version of PQcancel Message-ID: <202407161522.p22ucjamegmm@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="rqe3y3iifliytkrf" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202407161508.qwzkqxsmjusg@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --rqe3y3iifliytkrf Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2024-Jul-16, Alvaro Herrera wrote: > Maybe we can disable this test specifically on Cygwin. We could do that > by creating a postgres_fdw_cancel.sql file, with the current output for > all platforms, and a "SELECT version() ~ 'cygwin' AS skip_test" query, > as we do for encoding tests and such. Something like this. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ --rqe3y3iifliytkrf Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="0001-Split-out-the-query_cancel-test-in-postgres_fdw.patch" From dcb8876e16429e8cba9ea226454b0b77e2e00512 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Tue, 16 Jul 2024 17:18:55 +0200 Subject: [PATCH] Split out the query_cancel test in postgres_fdw so that it can be skipped in Cygwin --- contrib/postgres_fdw/Makefile | 2 +- .../postgres_fdw/expected/postgres_fdw.out | 16 --------------- .../postgres_fdw/expected/query_cancel.out | 20 +++++++++++++++++++ .../postgres_fdw/expected/query_cancel.sql | 17 ++++++++++++++++ .../postgres_fdw/expected/query_cancel_1.out | 3 +++ contrib/postgres_fdw/meson.build | 1 + contrib/postgres_fdw/sql/postgres_fdw.sql | 8 -------- contrib/postgres_fdw/sql/query_cancel.sql | 12 +++++++++++ 8 files changed, 54 insertions(+), 25 deletions(-) create mode 100644 contrib/postgres_fdw/expected/query_cancel.out create mode 100644 contrib/postgres_fdw/expected/query_cancel.sql create mode 100644 contrib/postgres_fdw/expected/query_cancel_1.out create mode 100644 contrib/postgres_fdw/sql/query_cancel.sql diff --git a/contrib/postgres_fdw/Makefile b/contrib/postgres_fdw/Makefile index c1b0cad453..b9fa699305 100644 --- a/contrib/postgres_fdw/Makefile +++ b/contrib/postgres_fdw/Makefile @@ -16,7 +16,7 @@ SHLIB_LINK_INTERNAL = $(libpq) EXTENSION = postgres_fdw DATA = postgres_fdw--1.0.sql postgres_fdw--1.0--1.1.sql -REGRESS = postgres_fdw +REGRESS = postgres_fdw query_cancel ifdef USE_PGXS PG_CONFIG = pg_config diff --git a/contrib/postgres_fdw/expected/postgres_fdw.out b/contrib/postgres_fdw/expected/postgres_fdw.out index 0cc77190dc..8852c19b48 100644 --- a/contrib/postgres_fdw/expected/postgres_fdw.out +++ b/contrib/postgres_fdw/expected/postgres_fdw.out @@ -2760,22 +2760,6 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c (10 rows) ALTER VIEW v4 OWNER TO regress_view_owner; --- Make sure this big CROSS JOIN query is pushed down -EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5; - QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- - Foreign Scan - Output: (count(*)) - Relations: Aggregate on ((((public.ft1) INNER JOIN (public.ft2)) INNER JOIN (public.ft4)) INNER JOIN (public.ft5)) - Remote SQL: SELECT count(*) FROM ((("S 1"."T 1" r1 INNER JOIN "S 1"."T 1" r2 ON (TRUE)) INNER JOIN "S 1"."T 3" r4 ON (TRUE)) INNER JOIN "S 1"."T 4" r6 ON (TRUE)) -(4 rows) - --- Make sure query cancellation works -BEGIN; -SET LOCAL statement_timeout = '10ms'; -select count(*) from ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5; -- this takes very long -ERROR: canceling statement due to statement timeout -COMMIT; -- ==================================================================== -- Check that userid to use when querying the remote table is correctly -- propagated into foreign rels present in subqueries under an UNION ALL diff --git a/contrib/postgres_fdw/expected/query_cancel.out b/contrib/postgres_fdw/expected/query_cancel.out new file mode 100644 index 0000000000..afef67aa8d --- /dev/null +++ b/contrib/postgres_fdw/expected/query_cancel.out @@ -0,0 +1,20 @@ +SELECT version() ~ 'cygwin' AS skip_test \gset +\if :skip_test +\quit +\endif +-- Make sure this big CROSS JOIN query is pushed down +EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5; + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Foreign Scan + Output: (count(*)) + Relations: Aggregate on ((((public.ft1) INNER JOIN (public.ft2)) INNER JOIN (public.ft4)) INNER JOIN (public.ft5)) + Remote SQL: SELECT count(*) FROM ((("S 1"."T 1" r1 INNER JOIN "S 1"."T 1" r2 ON (TRUE)) INNER JOIN "S 1"."T 3" r4 ON (TRUE)) INNER JOIN "S 1"."T 4" r6 ON (TRUE)) +(4 rows) + +-- Make sure query cancellation works +BEGIN; +SET LOCAL statement_timeout = '10ms'; +select count(*) from ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5; -- this takes very long +ERROR: canceling statement due to statement timeout +COMMIT; diff --git a/contrib/postgres_fdw/expected/query_cancel.sql b/contrib/postgres_fdw/expected/query_cancel.sql new file mode 100644 index 0000000000..45a26e06f5 --- /dev/null +++ b/contrib/postgres_fdw/expected/query_cancel.sql @@ -0,0 +1,17 @@ + +-- Make sure this big CROSS JOIN query is pushed down +EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5; + QUERY PLAN +--------------------------------------------------------------------------------------------------------------------------------------------------------------------- + Foreign Scan + Output: (count(*)) + Relations: Aggregate on ((((public.ft1) INNER JOIN (public.ft2)) INNER JOIN (public.ft4)) INNER JOIN (public.ft5)) + Remote SQL: SELECT count(*) FROM ((("S 1"."T 1" r1 INNER JOIN "S 1"."T 1" r2 ON (TRUE)) INNER JOIN "S 1"."T 3" r4 ON (TRUE)) INNER JOIN "S 1"."T 4" r6 ON (TRUE)) +(4 rows) + +-- Make sure query cancellation works +BEGIN; +SET LOCAL statement_timeout = '10ms'; +select count(*) from ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5; -- this takes very long +ERROR: canceling statement due to statement timeout +COMMIT; diff --git a/contrib/postgres_fdw/expected/query_cancel_1.out b/contrib/postgres_fdw/expected/query_cancel_1.out new file mode 100644 index 0000000000..c909f2917d --- /dev/null +++ b/contrib/postgres_fdw/expected/query_cancel_1.out @@ -0,0 +1,3 @@ +SELECT version() ~ 'cygwin' AS skip_test \gset +\if :skip_test +\quit diff --git a/contrib/postgres_fdw/meson.build b/contrib/postgres_fdw/meson.build index 2b86d8a6ee..f0803ee077 100644 --- a/contrib/postgres_fdw/meson.build +++ b/contrib/postgres_fdw/meson.build @@ -36,6 +36,7 @@ tests += { 'regress': { 'sql': [ 'postgres_fdw', + 'query_cancel', ], 'regress_args': ['--dlpath', meson.build_root() / 'src/test/regress'], }, diff --git a/contrib/postgres_fdw/sql/postgres_fdw.sql b/contrib/postgres_fdw/sql/postgres_fdw.sql index b57f8cfda6..1cfb5246ff 100644 --- a/contrib/postgres_fdw/sql/postgres_fdw.sql +++ b/contrib/postgres_fdw/sql/postgres_fdw.sql @@ -742,14 +742,6 @@ SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c SELECT t1.c1, t2.c2 FROM v4 t1 LEFT JOIN ft5 t2 ON (t1.c1 = t2.c1) ORDER BY t1.c1, t2.c1 OFFSET 10 LIMIT 10; ALTER VIEW v4 OWNER TO regress_view_owner; --- Make sure this big CROSS JOIN query is pushed down -EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5; --- Make sure query cancellation works -BEGIN; -SET LOCAL statement_timeout = '10ms'; -select count(*) from ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5; -- this takes very long -COMMIT; - -- ==================================================================== -- Check that userid to use when querying the remote table is correctly -- propagated into foreign rels present in subqueries under an UNION ALL diff --git a/contrib/postgres_fdw/sql/query_cancel.sql b/contrib/postgres_fdw/sql/query_cancel.sql new file mode 100644 index 0000000000..11fe077417 --- /dev/null +++ b/contrib/postgres_fdw/sql/query_cancel.sql @@ -0,0 +1,12 @@ +SELECT version() || 'cygwin' ~ 'cygwin' AS skip_test \gset +\if :skip_test +\quit +\endif + +-- Make sure this big CROSS JOIN query is pushed down +EXPLAIN (VERBOSE, COSTS OFF) SELECT count(*) FROM ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5; +-- Make sure query cancellation works +BEGIN; +SET LOCAL statement_timeout = '10ms'; +select count(*) from ft1 CROSS JOIN ft2 CROSS JOIN ft4 CROSS JOIN ft5; -- this takes very long +COMMIT; -- 2.39.2 --rqe3y3iifliytkrf--