Re: count(*) of zero rows returns 1

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: count(*) of zero rows returns 1
Дата
Msg-id 20130115191638.GB27934@momjian.us
обсуждение исходный текст
Ответ на Re: count(*) of zero rows returns 1  (Gurjeet Singh <singh.gurjeet@gmail.com>)
Список pgsql-hackers
On Mon, Jan 14, 2013 at 10:47:58PM -0500, Gurjeet Singh wrote:
> Interesting to note that SELECT * FROM table_with_zero_cols does not complain
> of anything.
>  
> postgres=# select * from test1;
> --
> (0 rows)
> 
> This I believe result of the fact that we allow user to drop all columns of a
> table.
> 
> On a side note, Postgres allows me to do this (which I don't think is a bug or
> useless): I inserted some rows into a table, and then dropped the columns. The
> resulting table has no columns, but live rows.
> 
> postgres=# select * from test_0_col_table ;
> --
> (200000 rows)

I found this funny.

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + It's impossible for everything to be true. +



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: pkg-config files for libpq and ecpg
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: count(*) of zero rows returns 1