Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 919ace0

Browse files
committed
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;
1 parent 06e3d84 commit 919ace0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/backend/parser/parse_coerce.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.54 2001/01/24 19:43:01 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/parser/parse_coerce.c,v 2.55 2001/02/27 07:07:00 ishii Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -225,6 +225,12 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *func_typeids)
225225
if (typeInheritsFrom(inputTypeId, targetTypeId))
226226
continue;
227227

228+
/* don't choke on references to no-longer-existing types */
229+
if (!typeidIsValid(inputTypeId))
230+
return false;
231+
if (!typeidIsValid(targetTypeId))
232+
return false;
233+
228234
/*
229235
* Else, try for explicit conversion using functions: look for a
230236
* single-argument function named with the target type name and

0 commit comments

Comments
 (0)