Skip to content

Commit c903bb7

Browse files
committed
Remove get_atttypmod()
This has been unused since 2004. get_atttypetypmodcoll() is often a better alternative. Reviewed-by: Michael Paquier <michael@paquier.xyz>
1 parent e6f5d1a commit c903bb7

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
return InvalidOid;
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(Oid relid, AttrNumber attnum)
891-
{
892-
HeapTuple tp;
893-
894-
tp = SearchSysCache2(ATTNUM,
895-
ObjectIdGetDatum(relid),
896-
Int16GetDatum(attnum));
897-
if (HeapTupleIsValid(tp))
898-
{
899-
Form_pg_attribute att_tup = (Form_pg_attribute) GETSTRUCT(tp);
900-
int32 result;
901-
902-
result = att_tup->atttypmod;
903-
ReleaseSysCache(tp);
904-
return result;
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
extern AttrNumber get_attnum(Oid relid, const char *attname);
8888
extern char get_attidentity(Oid relid, AttrNumber attnum);
8989
extern Oid get_atttype(Oid relid, AttrNumber attnum);
90-
extern int32 get_atttypmod(Oid relid, AttrNumber attnum);
9190
extern void get_atttypetypmodcoll(Oid relid, AttrNumber attnum,
9291
Oid *typid, int32 *typmod, Oid *collid);
9392
extern char *get_collation_name(Oid colloid);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy