git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bbc0483)
Remove typeidIsValid() checks in can_coerce_type(). These checks
2005年5月29日 18:24:14 +0000 (18:24 +0000)
2005年5月29日 18:24:14 +0000 (18:24 +0000)
were pretty expensive and I believe the case they were put in to
defend against can no longer arise, now that we have dependency checks
to prevent deletion of a type entry that is still referenced. Certainly
the example given in the CVS log entry can't happen anymore.
Since this was the only use of typeidIsValid(), remove the routine too.


diff --git a/src/backend/parser/parse_coerce.c b/src/backend/parser/parse_coerce.c
index 287e496570bc280e429c5733048c684b3c21ed8a..094e99a8acf5762632f99a3b479de758b6fcba1f 100644 (file)
--- a/src/backend/parser/parse_coerce.c
+++ b/src/backend/parser/parse_coerce.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.128 2005年05月05日 00:19:47 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.129 2005年05月29日 18:24:13 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -371,12 +371,6 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *target_typeids,
if (inputTypeId == targetTypeId)
continue;
- /* don't choke on references to no-longer-existing types */
- if (!typeidIsValid(inputTypeId))
- return false;
- if (!typeidIsValid(targetTypeId))
- return false;
-
/* accept if target is ANY */
if (targetTypeId == ANYOID)
continue;
diff --git a/src/backend/parser/parse_type.c b/src/backend/parser/parse_type.c
index 21ce20c5ecfcbafd553f6f384918fa3568bcff15..d8fba16b55541f1e482bbf189a1f6b57aeaffa9e 100644 (file)
--- a/src/backend/parser/parse_type.c
+++ b/src/backend/parser/parse_type.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/parser/parse_type.c,v 1.74 2005年04月28日 21:47:14 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/parser/parse_type.c,v 1.75 2005年05月29日 18:24:13 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -239,15 +239,6 @@ typenameType(const TypeName *typename)
return (Type) tup;
}
-/* check to see if a type id is valid, returns true if it is */
-bool
-typeidIsValid(Oid id)
-{
- return SearchSysCacheExists(TYPEOID,
- ObjectIdGetDatum(id),
- 0, 0, 0);
-}
-
/* return a Type structure, given a type id */
/* NB: caller must ReleaseSysCache the type tuple when done with it */
Type
diff --git a/src/include/parser/parse_type.h b/src/include/parser/parse_type.h
index 507919d5a7d81a77a2039aecedc7f0badff5eebb..24c004c8e7b249ad1bb8ebde21e3da4a050e3c2d 100644 (file)
--- a/src/include/parser/parse_type.h
+++ b/src/include/parser/parse_type.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/parser/parse_type.h,v 1.29 2004年12月31日 22:03:38 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/parser/parse_type.h,v 1.30 2005年05月29日 18:24:14 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -25,7 +25,6 @@ extern char *TypeNameToString(const TypeName *typename);
extern Oid typenameTypeId(const TypeName *typename);
extern Type typenameType(const TypeName *typename);
-extern bool typeidIsValid(Oid id);
extern Type typeidType(Oid id);
extern Oid typeTypeId(Type tp);
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /