BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: sean(dot)johnston(at)edgeintelligence(dot)com
Subject: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)
Date: 2019-04-25 13:32:31
Message-ID: 15781-2601b1002bad087c@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

The following bug has been logged on the website:

Bug reference: 15781
Logged by: Sean Johnston
Email address: sean(dot)johnston(at)edgeintelligence(dot)com
PostgreSQL version: 11.2
Operating system: docker image postgres:11.2
Description:

Example Query:

select exists(select c1 from ft4), avg(c1) from ft4 where c1 = (select
max(c1) from ft4);

Full Steps (modified from the postgres_fdw regression tests):

CREATE EXTENSION postgres_fdw;

CREATE SERVER testserver1 FOREIGN DATA WRAPPER postgres_fdw;
DO $d$
BEGIN
EXECUTE $$CREATE SERVER loopback FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (dbname '$$||current_database()||$$',
port '$$||current_setting('port')||$$'
)$$;
END;
$d$;
CREATE USER MAPPING FOR CURRENT_USER SERVER loopback;

CREATE SCHEMA "S 1";

CREATE TABLE "S 1"."T 3" (
c1 int NOT NULL,
c2 int NOT NULL,
c3 text,
CONSTRAINT t3_pkey PRIMARY KEY (c1)
);

CREATE FOREIGN TABLE ft4 (
c1 int NOT NULL,
c2 int NOT NULL,
c3 text
) SERVER loopback OPTIONS (schema_name 'S 1', table_name 'T 3');

select exists(select c1 from ft4), avg(c1) from ft4 where c1 = (select
max(c1) from ft4);

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2019-04-25 13:46:23 Re: BUG #15672: PostgreSQL 11.1/11.2 crashed after dropping a partition table
Previous Message PG Bug reporting form 2019-04-25 12:50:25 BUG #15780: Win10 PGS11 installer includes psAdmin3 LTS which does not support PGS11

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2019-04-25 13:46:23 Re: BUG #15672: PostgreSQL 11.1/11.2 crashed after dropping a partition table
Previous Message Etsuro Fujita 2019-04-25 13:17:12 Re: pgsql: Allow insert and update tuple routing and COPY for foreign table