diff options
author | Tatsuo Ishii <ishii@postgresql.org> | 2001-02-27 07:07:00 +0000 |
---|---|---|
committer | Tatsuo Ishii <ishii@postgresql.org> | 2001-02-27 07:07:00 +0000 |
commit | 919ace07d59f1a0fbb237b0ca348e4a7574b4042 (patch) | |
tree | b5a81438b8428385d3d87a5d0d2f9019c47e1baf /src | |
parent | 06e3d84d88222696f3bc65fa0d7bfe3dfeac889d (diff) | |
download | postgresql-919ace07d59f1a0fbb237b0ca348e4a7574b4042.tar.gz postgresql-919ace07d59f1a0fbb237b0ca348e4a7574b4042.zip |
Fix vacuum analyze error.
vacuum analyze on pg_type fails if bogus entries remain in pg_operator.
Here is a sample script to reproduce the problem.
drop table t1;
create table t1(i int);
drop function foo(t1,t1);
create function foo(t1,t1) returns bool as 'select true' language 'sql';
create operator = (
leftarg = t1,
rightarg = t1,
commutator = =,
procedure = foo
);
drop table t1;
vacuum analyze;
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/parser/parse_coerce.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/parser/parse_coerce.c b/src/backend/parser/parse_coerce.c index b91094216cb..69731ff89e1 100644 --- a/src/backend/parser/parse_coerce.c +++ b/src/backend/parser/parse_coerce.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.54 2001/01/24 19:43:01 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.55 2001/02/27 07:07:00 ishii Exp $ * *------------------------------------------------------------------------- */ @@ -225,6 +225,12 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids) if (typeInheritsFrom(inputTypeId, targetTypeId)) continue; + /* don't choke on references to no-longer-existing types */ + if (!typeidIsValid(inputTypeId)) + return false; + if (!typeidIsValid(targetTypeId)) + return false; + /* * Else, try for explicit conversion using functions: look for a * single-argument function named with the target type name and |