Shouldn't IsBinaryCoercible accept targettype = ANYOID?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Shouldn't IsBinaryCoercible accept targettype = ANYOID?
Date: 2013-12-19 16:14:06
Message-ID: 18794.1387469646@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Whilst fooling with the WITHIN GROUP patch, I noticed that
IsBinaryCoercible() doesn't think that anything-to-ANY is a binary
coercion. This was causing lookup_agg_function() to refuse to accept use
of support functions declared as taking ANY in aggregates with more
specific declared types. For the moment I hacked it by special-casing ANY
in lookup_agg_function, but shouldn't IsBinaryCoercible() accept the case?

A quick look through the callers suggests that in most cases the
targettype couldn't be ANY anyway, but there are one or two other places
where we're checking binary coercibility to an operator or function's
declared input type, and in those cases allowing ANY seems like the right
thing.

If there are not objections, I'll change this along with the WITHIN GROUP
stuff.

regards, tom lane

Browse pgsql-hackers by date

  From Date Subject
Next Message Joseph Kregloh 2013-12-19 16:34:24 pg_upgrade & tablespaces
Previous Message Robert Haas 2013-12-19 14:37:09 Re: preserving forensic information when we freeze