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

Commitc903bb7

Browse files
committed
Remove get_atttypmod()
This has been unused since 2004. get_atttypetypmodcoll() is often abetter alternative.Reviewed-by: Michael Paquier <michael@paquier.xyz>
1 parente6f5d1a commitc903bb7

File tree

2 files changed

+1
-29
lines changed

2 files changed

+1
-29
lines changed

‎src/backend/utils/cache/lsyscache.c

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -880,40 +880,13 @@ get_atttype(Oid relid, AttrNumber attnum)
880880
returnInvalidOid;
881881
}
882882

883-
/*
884-
* get_atttypmod
885-
*
886-
*Given the relation id and the attribute number,
887-
*return the "atttypmod" field from the attribute relation.
888-
*/
889-
int32
890-
get_atttypmod(Oidrelid,AttrNumberattnum)
891-
{
892-
HeapTupletp;
893-
894-
tp=SearchSysCache2(ATTNUM,
895-
ObjectIdGetDatum(relid),
896-
Int16GetDatum(attnum));
897-
if (HeapTupleIsValid(tp))
898-
{
899-
Form_pg_attributeatt_tup= (Form_pg_attribute)GETSTRUCT(tp);
900-
int32result;
901-
902-
result=att_tup->atttypmod;
903-
ReleaseSysCache(tp);
904-
returnresult;
905-
}
906-
else
907-
return-1;
908-
}
909-
910883
/*
911884
* get_atttypetypmodcoll
912885
*
913886
*A three-fer: given the relation id and the attribute number,
914887
*fetch atttypid, atttypmod, and attcollation in a single cache lookup.
915888
*
916-
* Unlike the otherwise-similar get_atttype/get_atttypmod, this routine
889+
* Unlike the otherwise-similar get_atttype, this routine
917890
* raises an error if it can't obtain the information.
918891
*/
919892
void

‎src/include/utils/lsyscache.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ extern char *get_attname(Oid relid, AttrNumber attnum, bool missing_ok);
8787
externAttrNumberget_attnum(Oidrelid,constchar*attname);
8888
externcharget_attidentity(Oidrelid,AttrNumberattnum);
8989
externOidget_atttype(Oidrelid,AttrNumberattnum);
90-
externint32get_atttypmod(Oidrelid,AttrNumberattnum);
9190
externvoidget_atttypetypmodcoll(Oidrelid,AttrNumberattnum,
9291
Oid*typid,int32*typmod,Oid*collid);
9392
externchar*get_collation_name(Oidcolloid);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp