mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Refactor typenameTypeId()
Split the old typenameTypeId() into two functions: A new typenameTypeId() that returns only a type OID, and typenameTypeIdAndMod() that returns type OID and typmod. This isolates call sites better that actually care about the typmod.
This commit is contained in:
@ -1496,8 +1496,8 @@ CreateCast(CreateCastStmt *stmt)
|
||||
ObjectAddress myself,
|
||||
referenced;
|
||||
|
||||
sourcetypeid = typenameTypeId(NULL, stmt->sourcetype, NULL);
|
||||
targettypeid = typenameTypeId(NULL, stmt->targettype, NULL);
|
||||
sourcetypeid = typenameTypeId(NULL, stmt->sourcetype);
|
||||
targettypeid = typenameTypeId(NULL, stmt->targettype);
|
||||
sourcetyptype = get_typtype(sourcetypeid);
|
||||
targettyptype = get_typtype(targettypeid);
|
||||
|
||||
@ -1779,8 +1779,8 @@ DropCast(DropCastStmt *stmt)
|
||||
ObjectAddress object;
|
||||
|
||||
/* when dropping a cast, the types must exist even if you use IF EXISTS */
|
||||
sourcetypeid = typenameTypeId(NULL, stmt->sourcetype, NULL);
|
||||
targettypeid = typenameTypeId(NULL, stmt->targettype, NULL);
|
||||
sourcetypeid = typenameTypeId(NULL, stmt->sourcetype);
|
||||
targettypeid = typenameTypeId(NULL, stmt->targettype);
|
||||
|
||||
object.classId = CastRelationId;
|
||||
object.objectId = get_cast_oid(sourcetypeid, targettypeid,
|
||||
|
Reference in New Issue
Block a user