Skip site navigation (1) Skip section navigation (2)

Re: zero-column table behavior

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: zero-column table behavior
Date: 2004-05-23 15:49:55
Message-ID: 24128.1085327395@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Neil Conway <neilc(at)samurai(dot)com> writes:
> Does the following zero-column behavior strike anyone else as being a 
> little strange? I can take a look at fixing this, I'm just curious if 
> there's a consensus that the status quo isn't optimal.

I think that psql's table-pretty-printing logic gets slightly confused
when there are zero columns.  It's never seemed high enough priority
to worry about to me, but if you wanna take a look, go for it.

> neilc=# select * from zero_col order by random();
> ERROR:  ORDER/GROUP BY expression not found in targetlist

> -- ISTM that ought to work

I agree, that's a bug (and a weird one).  I will look at this one.

> neilc=# create view zero_col_view as select * from zero_col;
> ERROR:  view must have at least one column

> -- ISTM that ought to work as well: if we allow zero-column tables,
> -- is there a good reason for disallowing zero-column views?

I'm not sure if that error is just overzealousness or if it is
protecting some implementation assumption.  Try removing the error check
and see if things work or not ...

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2004-05-23 15:53:13
Subject: Re: New horology failure
Previous:From: James William PyeDate: 2004-05-23 12:02:43
Subject: Re: Clean-up callbacks for non-SR functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group