mirror of
https://github.com/postgres/postgres.git
synced 2025-06-19 04:21:08 +03:00
get_relid_attribute_name is dead, long live get_attname
The modern way is to use a missing_ok argument instead of two separate almost-identical routines, so do that. Author: Michaël Paquier Reviewed-by: Álvaro Herrera Discussion: https://postgr.es/m/20180201063212.GE6398@paquier.xyz
This commit is contained in:
@ -1470,7 +1470,7 @@ generateClonedIndexStmt(RangeVar *heapRel, Oid heapRelid, Relation source_idx,
|
||||
/* Simple index column */
|
||||
char *attname;
|
||||
|
||||
attname = get_relid_attribute_name(indrelid, attnum);
|
||||
attname = get_attname(indrelid, attnum, false);
|
||||
keycoltype = get_atttype(indrelid, attnum);
|
||||
|
||||
iparam->name = attname;
|
||||
@ -3406,8 +3406,8 @@ transformPartitionBound(ParseState *pstate, Relation parent,
|
||||
|
||||
/* Get the only column's name in case we need to output an error */
|
||||
if (key->partattrs[0] != 0)
|
||||
colname = get_relid_attribute_name(RelationGetRelid(parent),
|
||||
key->partattrs[0]);
|
||||
colname = get_attname(RelationGetRelid(parent),
|
||||
key->partattrs[0], false);
|
||||
else
|
||||
colname = deparse_expression((Node *) linitial(partexprs),
|
||||
deparse_context_for(RelationGetRelationName(parent),
|
||||
@ -3491,8 +3491,8 @@ transformPartitionBound(ParseState *pstate, Relation parent,
|
||||
|
||||
/* Get the column's name in case we need to output an error */
|
||||
if (key->partattrs[i] != 0)
|
||||
colname = get_relid_attribute_name(RelationGetRelid(parent),
|
||||
key->partattrs[i]);
|
||||
colname = get_attname(RelationGetRelid(parent),
|
||||
key->partattrs[i], false);
|
||||
else
|
||||
{
|
||||
colname = deparse_expression((Node *) list_nth(partexprs, j),
|
||||
|
Reference in New Issue
Block a user