Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd66daab

Browse files
committed
Remove typeidIsValid() checks in can_coerce_type(). These checks
were pretty expensive and I believe the case they were put in todefend against can no longer arise, now that we have dependency checksto prevent deletion of a type entry that is still referenced. Certainlythe example given in the CVS log entry can't happen anymore.Since this was the only use of typeidIsValid(), remove the routine too.
1 parentbbc0483 commitd66daab

File tree

3 files changed

+3
-19
lines changed

3 files changed

+3
-19
lines changed

‎src/backend/parser/parse_coerce.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.128 2005/05/05 00:19:47 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/parser/parse_coerce.c,v 2.129 2005/05/29 18:24:13 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -371,12 +371,6 @@ can_coerce_type(int nargs, Oid *input_typeids, Oid *target_typeids,
371371
if (inputTypeId==targetTypeId)
372372
continue;
373373

374-
/* don't choke on references to no-longer-existing types */
375-
if (!typeidIsValid(inputTypeId))
376-
return false;
377-
if (!typeidIsValid(targetTypeId))
378-
return false;
379-
380374
/* accept if target is ANY */
381375
if (targetTypeId==ANYOID)
382376
continue;

‎src/backend/parser/parse_type.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/parser/parse_type.c,v 1.74 2005/04/28 21:47:14 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/parser/parse_type.c,v 1.75 2005/05/29 18:24:13 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -239,15 +239,6 @@ typenameType(const TypeName *typename)
239239
return (Type)tup;
240240
}
241241

242-
/* check to see if a type id is valid, returns true if it is */
243-
bool
244-
typeidIsValid(Oidid)
245-
{
246-
returnSearchSysCacheExists(TYPEOID,
247-
ObjectIdGetDatum(id),
248-
0,0,0);
249-
}
250-
251242
/* return a Type structure, given a type id */
252243
/* NB: caller must ReleaseSysCache the type tuple when done with it */
253244
Type

‎src/include/parser/parse_type.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/parser/parse_type.h,v 1.29 2004/12/31 22:03:38 pgsql Exp $
10+
* $PostgreSQL: pgsql/src/include/parser/parse_type.h,v 1.30 2005/05/29 18:24:14 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -25,7 +25,6 @@ extern char *TypeNameToString(const TypeName *typename);
2525
externOidtypenameTypeId(constTypeName*typename);
2626
externTypetypenameType(constTypeName*typename);
2727

28-
externbooltypeidIsValid(Oidid);
2928
externTypetypeidType(Oidid);
3029

3130
externOidtypeTypeId(Typetp);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp