Re: [HACKERS] any, anyelement, and anyarray

2006-05-12 Thread Tom Lane
Thomas Hallgren <[EMAIL PROTECTED]> writes: > I've been trying to use "any" with no luck. How do I declare a function > that takes an "any" as a parameter? ANY is a reserved word, so to use it as a type name you need quotes: regression=# create function foo("any") returns int as '' language sql;

Re: [HACKERS] any, anyelement, and anyarray

2006-05-12 Thread Thomas Hallgren
Tom Lane wrote: Thomas Hallgren <[EMAIL PROTECTED]> writes: - Why does PostgreSQL declare three different generic types? Isn't one enough? ISTM it would be far simpler to use constructs like 'any' and 'any[]' but neither of them are permitted. "any" isn't the same as "anyelement", bec

Re: [HACKERS] any, anyelement, and anyarray

2006-05-12 Thread Tom Lane
Thomas Hallgren <[EMAIL PROTECTED]> writes: > - Why does PostgreSQL declare three different generic types? Isn't one > enough? ISTM it would be far simpler to use constructs like 'any' and > 'any[]' but neither of them are permitted. "any" isn't the same as "anyelement", because it doesn't have

[HACKERS] any, anyelement, and anyarray

2006-05-12 Thread Thomas Hallgren
I have some questions regarding any, anyelement, and anyarray. - Why does PostgreSQL declare three different generic types? Isn't one enough? ISTM it would be far simpler to use constructs like 'any' and 'any[]' but neither of them are permitted. - Why isn't the 'anyarray' declared as an arra