Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux