I said:
> [EMAIL PROTECTED] (Edwin S. Ramirez) writes:
> [ "select count('x') from some_table" fails ]
> The most direct fix is probably to make any_in() return some random
> value (may as well be ((Datum) 0)) instead of producing an error.
After further investigation I have decided that this is
I tried :
select count('x') from patients;
And I get the same error.
select count('x'); should return the same as select count(*); which
returns 1.
Previous Postgres versions returned 1.
-ESR-
Peter Eisentraut wrote:
Tom Lane wrote:
Bruce Momjian <[EMAIL PROTECTED]> writes:
Peter Eisentraut <[EMAIL PROTECTED]> writes:
> In general,
> SELECT count(expr) FROM table1;
> counts the number of rows in table1 where expr evaluates to not null.
Right. Edwin obscured the datatype issue by leaving off a table, but
the issue is real anyway:
regression=# select count(1) from
Tom Lane wrote:
> Bruce Momjian <[EMAIL PROTECTED]> writes:
> > What is COUNT('x') supposed to return? 1? Is that legal SQL?
>
> Why not?
Because there is nothing to count.
In general,
SELECT count(expr) FROM table1;
counts the number of rows in table1 where expr evaluates to not null.
If t
Bruce Momjian <[EMAIL PROTECTED]> writes:
> What is COUNT('x') supposed to return? 1? Is that legal SQL?
Why not? Vanilla SQL would assume the string is CHAR type.
regards, tom lane
---(end of broadcast)---
TIP 3: if post
Tom Lane wrote:
> [EMAIL PROTECTED] (Edwin S. Ramirez) writes:
> > It appears that the count('x') will no longer work without a type
> > cast. Is this on purpose?
>
> > warehouse=# select count('x') ;
> > ERROR: cannot accept a value of type any
>
> Hm, that query seems like it should be legal.
[EMAIL PROTECTED] (Edwin S. Ramirez) writes:
> It appears that the count('x') will no longer work without a type
> cast. Is this on purpose?
> warehouse=# select count('x') ;
> ERROR: cannot accept a value of type any
Hm, that query seems like it should be legal. (You get the same
from "select
Hello,
It appears that the count('x') will no longer work without a type
cast. Is this on purpose? I've already modified my code to use
count(*) instead, but I decided to mention it anyway.
warehouse=# select count('x') ;
ERROR: cannot accept a value of type any
warehouse=# select count('x'::t