Re: Table name used as aggregate argument

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Table name used as aggregate argument
Date: 2005-02-07 16:11:27
Message-ID: 27395.1107792687@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org> writes:
> How come this work in pg (8.0 and older):
> CREATE TABLE bug (x int);
> SELECT count(bug) FROM bug;

> Shouldn't it complain and say that "bug" is not a column?

No. This is a perfectly good, if somewhat historical, spelling of

SELECT count(bug.*) FROM bug;

Since count() takes any data type at all, a record type is just as
good as anything else...

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Guerin 2005-02-07 20:26:53 ERROR: cache lookup failed for relation 17442 (repost)
Previous Message Dennis Bjorklund 2005-02-07 15:47:26 Table name used as aggregate argument