[GENERAL] Count column with name 'count' returns multiple rows. Why?

Поиск
Список
Период
Сортировка
От Rob Audenaerde
Тема [GENERAL] Count column with name 'count' returns multiple rows. Why?
Дата
Msg-id CAPz8bx1sf0vzncvYUiEJq9MDf9xvELi2tJLY2jTN=t=L68nSGA@mail.gmail.com
обсуждение исходный текст
Ответы Re: [GENERAL] Count column with name 'count' returns multiple rows.Why?
Список pgsql-general
Hi all,

I don't understand why this query:

   select count(base.*) from mytable base;

does return multiple rows.

   select count(1) from mytable base;

returns the proper count.

There is a column with the name 'count'.

Can anyone please explain this behaviour?

Steps to reproduce:

create table s91("count" int);
insert into s91 values (1),(2),(3);
select count(base.*) from s91 base;

 count 
-------
     1
     2
     3
(3 rows)

I think this is either a bug or an undocumented feature?


ps. I posted this question on StackOverflow as well: https://stackoverflow.com/q/45752412/461499

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

Предыдущее
От: Dan
Дата:
Сообщение: [GENERAL] Number of rows affected by ON CASCADE
Следующее
От: Justin Pryzby
Дата:
Сообщение: Re: [GENERAL] Count column with name 'count' returns multiple rows.Why?