BUG #12792: I can do a SELECT with no fields - Mailing list pgsql-bugs

From lr@pcorp.us
Subject BUG #12792: I can do a SELECT with no fields
Date
Msg-id 20150220150844.8729.17005@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #12792: I can do a SELECT with no fields
Re: BUG #12792: I can do a SELECT with no fields
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      12792
Logged by:          Regina Obe
Email address:      lr@pcorp.us
PostgreSQL version: 9.4.1
Operating system:   Windows 2008 R2
Description:

I'm not sure if this is a bug or not, but it seems like a misfeature if it
isn't.

I made the typo of doing

SELECT FROM sometable;

you can also trigger the issue with just doing:

SELECT ;

outputs:
--
(1 row)

I thought there was something wrong with my viewer since it clearly showed
rows, but no fields.

In 9.3 -- this would just error out as I think most databases do.  So this
was a bit of a gotcha.

I'm not sure if this issue existed in 9.4.0 alreadyy since I've already
upgraded my database.

pgsql-bugs by date:

Previous
From: Andrew Gierth
Date:
Subject: Re: BUG #12789: Views defined with VALUES lose their column names when dumped
Next
From: Tom Lane
Date:
Subject: Re: BUG #12792: I can do a SELECT with no fields