Re: Postgres 7.3.5 and count('x') - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Postgres 7.3.5 and count('x')
Date
Msg-id 29653.1070682697@sss.pgh.pa.us
Whole thread Raw
In response to Postgres 7.3.5 and count('x')  (ramirez@idconcepts.org (Edwin S. Ramirez))
Responses Re: Postgres 7.3.5 and count('x')
Re: Postgres 7.3.5 and count('x')
List pgsql-hackers
ramirez@idconcepts.org (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 count('x') from some_table", so it's not the lack of
a table to iterate over that's the issue.)

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.
I can't offhand see any real downside to doing so, but I'm a little
worried that it might introduce a gap in the type system.  Can anyone
see a reason not to do that?  Or a better fix for Edwin's complaint?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: request for feedback - read-only GUC variables,
Next
From: Tom Lane
Date:
Subject: Re: postgresql-7.4 make error: tuptoaster.c: In function