diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2004-06-16 01:27:00 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2004-06-16 01:27:00 +0000 |
commit | d70a42e6424e1531355ce9d1d1aa59e329b3c0e6 (patch) | |
tree | a562d86d0f5128916ecfd213906996a12940335e /src/include/parser/parse_coerce.h | |
parent | 8e7349b73806a993f72976bbf7dfaa9b1cf270b8 (diff) | |
download | postgresql-d70a42e6424e1531355ce9d1d1aa59e329b3c0e6.tar.gz postgresql-d70a42e6424e1531355ce9d1d1aa59e329b3c0e6.zip |
Represent type-specific length coercion functions as pg_cast entries,
eliminating the former hard-wired convention about their names. Allow
pg_cast entries to represent both type coercion and length coercion in
a single step --- this is represented by a function that takes an
extra typmod argument, just like a length coercion function. This
nicely merges the type and length coercion mechanisms into something
at least a little cleaner than we had before. Make use of the single-
coercion-step behavior to fix integer-to-bit coercion so that coercing
to bit(n) yields the rightmost n bits of the integer instead of the
leftmost n bits. This should fix recurrent complaints about the odd
behavior of this coercion. Clean up the documentation of the bit string
functions, and try to put it where people might actually find it.
Also, get rid of the unreliable heuristics in ruleutils.c about whether
to display nested coercion steps; instead require parse_coerce.c to
label them properly in the first place.
Diffstat (limited to 'src/include/parser/parse_coerce.h')
-rw-r--r-- | src/include/parser/parse_coerce.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/include/parser/parse_coerce.h b/src/include/parser/parse_coerce.h index 8700200b51b..c1c83d514d9 100644 --- a/src/include/parser/parse_coerce.h +++ b/src/include/parser/parse_coerce.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/parser/parse_coerce.h,v 1.56 2003/11/29 22:41:09 pgsql Exp $ + * $PostgreSQL: pgsql/src/include/parser/parse_coerce.h,v 1.57 2004/06/16 01:26:53 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -47,10 +47,10 @@ extern Node *coerce_to_target_type(ParseState *pstate, extern bool can_coerce_type(int nargs, Oid *input_typeids, Oid *target_typeids, CoercionContext ccontext); extern Node *coerce_type(ParseState *pstate, Node *node, - Oid inputTypeId, Oid targetTypeId, + Oid inputTypeId, Oid targetTypeId, int32 targetTypeMod, CoercionContext ccontext, CoercionForm cformat); extern Node *coerce_to_domain(Node *arg, Oid baseTypeId, Oid typeId, - CoercionForm cformat); + CoercionForm cformat, bool hideInputCoercion); extern Node *coerce_to_boolean(ParseState *pstate, Node *node, const char *constructName); @@ -76,6 +76,6 @@ extern Oid resolve_generic_type(Oid declared_type, extern bool find_coercion_pathway(Oid targetTypeId, Oid sourceTypeId, CoercionContext ccontext, Oid *funcid); -extern Oid find_typmod_coercion_function(Oid typeId, int *nargs); +extern Oid find_typmod_coercion_function(Oid typeId); #endif /* PARSE_COERCE_H */ |