33 * procedural language
44 *
55 * IDENTIFICATION
6- * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.96 2005/11/22 18: 17:33 momjian Exp $
6+ * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.97 2005/12/09 17:08:49 tgl Exp $
77 *
88 * This software is copyrighted by Jan Wieck - Hamburg.
99 *
@@ -1316,25 +1316,25 @@ plpgsql_parse_dblwordtype(char *word)
131613160 ,0 ,0 );
13171317if (!HeapTupleIsValid (classtup ))
13181318gotodone ;
1319+ classStruct = (Form_pg_class )GETSTRUCT (classtup );
13191320
13201321/*
13211322 * It must be a relation, sequence, view, or type
13221323 */
1323- classStruct = (Form_pg_class )GETSTRUCT (classtup );
13241324if (classStruct -> relkind != RELKIND_RELATION &&
13251325classStruct -> relkind != RELKIND_SEQUENCE &&
13261326classStruct -> relkind != RELKIND_VIEW &&
13271327classStruct -> relkind != RELKIND_COMPOSITE_TYPE )
13281328gotodone ;
13291329
13301330/*
1331- * Fetch the named table field andit's type
1331+ * Fetch the named table field andits type
13321332 */
13331333attrtup = SearchSysCacheAttName (classOid ,cp [1 ]);
13341334if (!HeapTupleIsValid (attrtup ))
13351335gotodone ;
1336-
13371336attrStruct = (Form_pg_attribute )GETSTRUCT (attrtup );
1337+
13381338typetup = SearchSysCache (TYPEOID ,
13391339ObjectIdGetDatum (attrStruct -> atttypid ),
134013400 ,0 ,0 );
@@ -1373,10 +1373,10 @@ plpgsql_parse_tripwordtype(char *word)
13731373{
13741374Oid classOid ;
13751375HeapTuple classtup = NULL ;
1376- Form_pg_class classStruct ;
13771376HeapTuple attrtup = NULL ;
1378- Form_pg_attribute attrStruct ;
13791377HeapTuple typetup = NULL ;
1378+ Form_pg_class classStruct ;
1379+ Form_pg_attribute attrStruct ;
13801380char * cp [2 ];
13811381char * colname [1 ];
13821382int qualified_att_len ;
@@ -1421,26 +1421,26 @@ plpgsql_parse_tripwordtype(char *word)
142114210 ,0 ,0 );
14221422if (!HeapTupleIsValid (classtup ))
14231423gotodone ;
1424+ classStruct = (Form_pg_class )GETSTRUCT (classtup );
14241425
14251426/*
14261427 * It must be a relation, sequence, view, or type
14271428 */
1428- classStruct = (Form_pg_class )GETSTRUCT (classtup );
14291429if (classStruct -> relkind != RELKIND_RELATION &&
14301430classStruct -> relkind != RELKIND_SEQUENCE &&
14311431classStruct -> relkind != RELKIND_VIEW &&
14321432classStruct -> relkind != RELKIND_COMPOSITE_TYPE )
14331433gotodone ;
14341434
14351435/*
1436- * Fetch the named table field andit's type
1436+ * Fetch the named table field andits type
14371437 */
14381438plpgsql_convert_ident (cp [1 ],colname ,1 );
14391439attrtup = SearchSysCacheAttName (classOid ,colname [0 ]);
14401440if (!HeapTupleIsValid (attrtup ))
14411441gotodone ;
1442-
14431442attrStruct = (Form_pg_attribute )GETSTRUCT (attrtup );
1443+
14441444typetup = SearchSysCache (TYPEOID ,
14451445ObjectIdGetDatum (attrStruct -> atttypid ),
144614460 ,0 ,0 );
@@ -1459,7 +1459,7 @@ plpgsql_parse_tripwordtype(char *word)
14591459done :
14601460if (HeapTupleIsValid (classtup ))
14611461ReleaseSysCache (classtup );
1462- if (HeapTupleIsValid (classtup ))
1462+ if (HeapTupleIsValid (attrtup ))
14631463ReleaseSysCache (attrtup );
14641464if (HeapTupleIsValid (typetup ))
14651465ReleaseSysCache (typetup );