1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-14 18:42:34 +03:00

Made abstime/reltime use int4 instead of time_t (TODO item)

Made type equivalency apply to aggregates (TODO item)
Fixed parsing bug in psql
Reverted some stupid options changes I made to pg_dump
This commit is contained in:
Peter Eisentraut
2000-01-24 19:34:19 +00:00
parent 0dbffa704a
commit bdb41ad0e7
6 changed files with 54 additions and 47 deletions

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.66 2000/01/10 17:14:36 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.67 2000/01/24 19:34:14 petere Exp $
*
*-------------------------------------------------------------------------
*/
@ -176,8 +176,26 @@ agg_select_candidate(Oid typeid, CandidateList candidates)
current_category;
/*
* Look for candidates which allow coersion and have a preferred type.
* Keep all candidates if none match.
* First look for exact matches or binary compatible matches.
* (Of course exact matches shouldn't even get here, but anyway.)
*/
for (current_candidate = candidates;
current_candidate != NULL;
current_candidate = current_candidate->next)
{
current_typeid = current_candidate->args[0];
if (current_typeid == typeid
|| IS_BINARY_COMPATIBLE(current_typeid, typeid))
{
/* we're home free */
return current_typeid;
}
}
/*
* If no luck that way, look for candidates which allow coersion
* and have a preferred type. Keep all candidates if none match.
*/
category = TypeCategory(typeid);
ncandidates = 0;
@ -189,7 +207,7 @@ agg_select_candidate(Oid typeid, CandidateList candidates)
current_typeid = current_candidate->args[0];
current_category = TypeCategory(current_typeid);
if ((current_category == category)
if (current_category == category
&& IsPreferredType(current_category, current_typeid)
&& can_coerce_type(1, &typeid, &current_typeid))
{