pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #12792: I can do a SELECT with no fields
3+ messages / 3 participants
[nested] [flat]

* BUG #12792: I can do a SELECT with no fields
@ 2015-02-20 15:08 lr@pcorp.us
  2015-02-20 15:20 ` Re: BUG #12792: I can do a SELECT with no fields Tom Lane <tgl@sss.pgh.pa.us>
  2015-02-20 15:20 ` Re: BUG #12792: I can do a SELECT with no fields Kevin Grittner <kgrittn@ymail.com>
  0 siblings, 2 replies; 3+ messages in thread

From: lr@pcorp.us @ 2015-02-20 15:08 UTC (permalink / raw)
  To: 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.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #12792: I can do a SELECT with no fields
  2015-02-20 15:08 BUG #12792: I can do a SELECT with no fields lr@pcorp.us
@ 2015-02-20 15:20 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2015-02-20 15:20 UTC (permalink / raw)
  To: lr@pcorp.us; +Cc: pgsql-bugs

lr@pcorp.us writes:
> I'm not sure if this is a bug or not, but it seems like a misfeature if it
> isn't.

It is an intentional change, see the 9.4 release notes.

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: BUG #12792: I can do a SELECT with no fields
  2015-02-20 15:08 BUG #12792: I can do a SELECT with no fields lr@pcorp.us
@ 2015-02-20 15:20 ` Kevin Grittner <kgrittn@ymail.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Kevin Grittner @ 2015-02-20 15:20 UTC (permalink / raw)
  To: lr@pcorp.us <lr@pcorp.us>; pgsql-bugs

"lr@pcorp.us" <lr@pcorp.us> wrote:

> I'm not sure if this is a bug or not,

It it's not.  See the release notes:

http://www.postgresql.org/docs/9.4/interactive/release-9-4.html

| Allow SELECT to have an empty target list (Tom Lane)
|
| This was added so that views that select from a table with zero
| columns can be dumped and restored correctly.

For a more detailed explanation of why this feature was added, see
the commit message:

http://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=1b4f7f93b4693858cb983af3cd557f6097dab6...

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2015-02-20 15:20 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-02-20 15:08 BUG #12792: I can do a SELECT with no fields lr@pcorp.us
2015-02-20 15:20 ` Tom Lane <tgl@sss.pgh.pa.us>
2015-02-20 15:20 ` Kevin Grittner <kgrittn@ymail.com>

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