BUG #8648: Segmentation fault on EXISTS with no *columns*

From: a(dot)g(dot)nienhuis(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #8648: Segmentation fault on EXISTS with no *columns*
Date: 2013-12-03 00:38:03
Message-ID: E1Vne03-0007ru-Sg@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 8648
Logged by: Arjen Nienhuis
Email address: a(dot)g(dot)nienhuis(at)gmail(dot)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.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2013-12-03 01:31:09 Re: BUG #8648: Segmentation fault on EXISTS with no *columns*
Previous Message fburgess 2013-12-02 23:32:27 pg_upgrade error attempting to upgrade from PostgreSQL 9.1.6 with postgis 2.1.1 to PostgreSQL 9.3.0