BUG #8648: Segmentation fault on EXISTS with no *columns* - Mailing list pgsql-bugs

From a.g.nienhuis@gmail.com
Subject BUG #8648: Segmentation fault on EXISTS with no *columns*
Date
Msg-id E1Vne03-0007ru-Sg@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #8648: Segmentation fault on EXISTS with no *columns*  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      8648
Logged by:          Arjen Nienhuis
Email address:      a.g.nienhuis@gmail.com
PostgreSQL version: 9.1.10
Operating system:   Ubuntu
Description:

Hi,


I found a bug trying to use EXISTS with a table with no columns. It works
with SELECT 1 and not with SELECT *:


arjen=> SELECT VERSION();
                                                   version

-------------------------------------------------------------------------------------------------------------
 PostgreSQL 9.1.10 on x86_64-unknown-linux-gnu, compiled by gcc
(Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3, 64-bit
(1 row)


arjen=> CREATE TABLE test ();
CREATE TABLE
arjen=> SELECT EXISTS (SELECT 1 FROM test);
 ?column?
----------
 f
(1 row)


arjen=> SELECT EXISTS (SELECT * FROM test);
The connection to the server was lost. Attempting reset: Failed.
!>




In the log:


2013-12-03 01:23:36 CET LOG:  server process (PID 17249) was terminated by
signal 11: Segmentation fault
2013-12-03 01:23:36 CET LOG:  terminating any other active server processes
2013-12-03 01:23:36 CET WARNING:  terminating connection because of crash of
another server process
2013-12-03 01:23:36 CET DETAIL:  The postmaster has commanded this server
process to roll back the current transaction and exit, because another
server process exited abnormally and possibly corrupted shared memory.
2013-12-03 01:23:36 CET HINT:  In a moment you should be able to reconnect
to the database and repeat your command.

pgsql-bugs by date:

Previous
From:
Date:
Subject: pg_upgrade error attempting to upgrade from PostgreSQL 9.1.6 with postgis 2.1.1 to PostgreSQL 9.3.0
Next
From: Tom Lane
Date:
Subject: Re: BUG #8648: Segmentation fault on EXISTS with no *columns*