mirror of
https://github.com/postgres/postgres.git
synced 2025-11-04 20:11:56 +03:00
Change tupledesc->attrs[n] to TupleDescAttr(tupledesc, n).
This is a mechanical change in preparation for a later commit that will change the layout of TupleDesc. Introducing a macro to abstract the details of where attributes are stored will allow us to change that in separate step and revise it in future. Author: Thomas Munro, editorialized by Andres Freund Reviewed-By: Andres Freund Discussion: https://postgr.es/m/CAEepm=0ZtQ-SpsgCyzzYpsXS6e=kZWqk3g5Ygn3MDV7A8dabUA@mail.gmail.com
This commit is contained in:
5
src/backend/utils/cache/catcache.c
vendored
5
src/backend/utils/cache/catcache.c
vendored
@@ -797,7 +797,7 @@ do { \
|
||||
if (cache->cc_key[i] > 0) { \
|
||||
elog(DEBUG2, "CatalogCacheInitializeCache: load %d/%d w/%d, %u", \
|
||||
i+1, cache->cc_nkeys, cache->cc_key[i], \
|
||||
tupdesc->attrs[cache->cc_key[i] - 1]->atttypid); \
|
||||
TupleDescAttr(tupdesc, cache->cc_key[i] - 1)->atttypid); \
|
||||
} else { \
|
||||
elog(DEBUG2, "CatalogCacheInitializeCache: load %d/%d w/%d", \
|
||||
i+1, cache->cc_nkeys, cache->cc_key[i]); \
|
||||
@@ -862,7 +862,8 @@ CatalogCacheInitializeCache(CatCache *cache)
|
||||
|
||||
if (cache->cc_key[i] > 0)
|
||||
{
|
||||
Form_pg_attribute attr = tupdesc->attrs[cache->cc_key[i] - 1];
|
||||
Form_pg_attribute attr = TupleDescAttr(tupdesc,
|
||||
cache->cc_key[i] - 1);
|
||||
|
||||
keytype = attr->atttypid;
|
||||
/* cache key columns should always be NOT NULL */
|
||||
|
||||
Reference in New Issue
Block a user