Re: [HACKERS] Postgres 7.3.5 and count('x')

2003-12-15 Thread Tom Lane
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

Re: [HACKERS] Postgres 7.3.5 and count('x')

2003-12-09 Thread Edwin S. Ramirez
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:

Re: [HACKERS] Postgres 7.3.5 and count('x')

2003-12-06 Thread Tom Lane
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

Re: [HACKERS] Postgres 7.3.5 and count('x')

2003-12-06 Thread Peter Eisentraut
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

Re: [HACKERS] Postgres 7.3.5 and count('x')

2003-12-06 Thread Tom Lane
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

Re: [HACKERS] Postgres 7.3.5 and count('x')

2003-12-06 Thread Bruce Momjian
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.

Re: [HACKERS] Postgres 7.3.5 and count('x')

2003-12-05 Thread Tom Lane
[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

[HACKERS] Postgres 7.3.5 and count('x')

2003-12-05 Thread Edwin S. Ramirez
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