Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bb9f6e4

Browse files
author
Marina Polyakova
committed
Convert the reg* input functions to report (most) errors softly.
See the commit 858e776c84f48841e7e16fba7b690b76e54f3675 (Convert the reg* input functions to report (most) errors softly.) in PostgreSQL 16. The function qualified_relnames_to_rangevars is used in the functions create_hash_partitions_internal and create_range_partitions_internal. It looks like these functions should not skip partition names (e.g. in the functions create_hash_partitions and create_range_partitions respectively)..
1 parent 47806e7 commit bb9f6e4

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/include/compat/pg_compat.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,6 +1084,17 @@ extern AttrNumber *convert_tuples_by_name_map(TupleDesc indesc,
10841084
expression_tree_mutator((node), (mutator), (context))
10851085
#endif
10861086

1087+
/*
1088+
* stringToQualifiedNameList
1089+
*/
1090+
#if PG_VERSION_NUM >= 160000
1091+
#define stringToQualifiedNameListCompat(string) \
1092+
stringToQualifiedNameList((string), NULL)
1093+
#else
1094+
#define stringToQualifiedNameListCompat(string) \
1095+
stringToQualifiedNameList((string))
1096+
#endif
1097+
10871098
/*
10881099
* -------------
10891100
* Common code

src/utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ qualified_relnames_to_rangevars(char **relnames, size_t nrelnames)
518518
rangevars = palloc(sizeof(RangeVar *) * nrelnames);
519519
for (i = 0; i < nrelnames; i++)
520520
{
521-
List *nl = stringToQualifiedNameList(relnames[i]);
521+
List *nl = stringToQualifiedNameListCompat(relnames[i]);
522522

523523
rangevars[i] = makeRangeVarFromNameList(nl);
524524
}

0 commit comments

Comments
 (0)