diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-11-11 19:22:49 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-11-11 19:22:49 +0000 |
commit | 0bd4da23a4bee4fb3b6b61cb0fadc43c054c5ddb (patch) | |
tree | 2a37c084e71feafe8e502758e7e01446192d9529 /src/backend/commands/operatorcmds.c | |
parent | 6b8cc88268fcf33b5e2d3c230f097dff0541398f (diff) | |
download | postgresql-0bd4da23a4bee4fb3b6b61cb0fadc43c054c5ddb.tar.gz postgresql-0bd4da23a4bee4fb3b6b61cb0fadc43c054c5ddb.zip |
Ensure that typmod decoration on a datatype name is validated in all cases,
even in code paths where we don't pay any subsequent attention to the typmod
value. This seems needed in view of the fact that 8.3's generalized typmod
support will accept a lot of bogus syntax, such as "timestamp(foo)" or
"record(int, 42)" --- if we allow such things to pass without comment,
users will get confused. Per a recent example from Greg Stark.
To implement this in a way that's not very vulnerable to future
bugs-of-omission, refactor the API of parse_type.c's TypeName lookup routines
so that typmod validation is folded into the base lookup operation. Callers
can still choose not to receive the encoded typmod, but we'll check the
decoration anyway if it's present.
Diffstat (limited to 'src/backend/commands/operatorcmds.c')
-rw-r--r-- | src/backend/commands/operatorcmds.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/commands/operatorcmds.c b/src/backend/commands/operatorcmds.c index dd872d6a642..8de6b4bebfd 100644 --- a/src/backend/commands/operatorcmds.c +++ b/src/backend/commands/operatorcmds.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/operatorcmds.c,v 1.36 2007/06/02 23:36:35 petere Exp $ + * $PostgreSQL: pgsql/src/backend/commands/operatorcmds.c,v 1.37 2007/11/11 19:22:48 tgl Exp $ * * DESCRIPTION * The "DefineFoo" routines take the parse tree and pick out the @@ -149,9 +149,9 @@ DefineOperator(List *names, List *parameters) /* Transform type names to type OIDs */ if (typeName1) - typeId1 = typenameTypeId(NULL, typeName1); + typeId1 = typenameTypeId(NULL, typeName1, NULL); if (typeName2) - typeId2 = typenameTypeId(NULL, typeName2); + typeId2 = typenameTypeId(NULL, typeName2, NULL); /* * now have OperatorCreate do all the work.. |