pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: sean.johnston@edgeintelligence.com
Subject: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)
Date: Thu, 25 Apr 2019 13:32:31 +0000
Message-ID: <15781-2601b1002bad087c@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15781
Logged by:          Sean Johnston
Email address:      sean.johnston@edgeintelligence.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);



view thread (13+ messages)  latest in thread

Message-ID: <15781-2601b1002bad087c@postgresql.org>
Permalink:  ../15781-2601b1002bad087c@postgresql.org/
Also on:    postgresql.org/message-id/15781-2601b1002bad087c@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, sean.johnston@edgeintelligence.com
  Subject: Re: BUG #15781: subselect on foreign table (postgres_fdw) can crash (segfault)
  In-Reply-To: <15781-2601b1002bad087c@postgresql.org>
  References: <15781-2601b1002bad087c@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox