Skip to content

Commit 80f583f

Browse files
committed
Fix omission of locations in outfuncs/readfuncs partitioning node support.
We could have limped along without this for v10, which was my intention when I annotated the bug in commit 76a3df6. But consensus is that it's better to fix it now and take the cost of a post-beta1 initdb (which is needed because these node types are stored in pg_class.relpartbound). Since we're forcing initdb anyway, take the opportunity to make the node type identification strings match the node struct names, instead of being randomly different from them. Discussion: https://postgr.es/m/E1dFBEX-0004wt-8t@gemulon.postgresql.org
1 parent d5cb3ba commit 80f583f

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

src/backend/nodes/outfuncs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3530,7 +3530,7 @@ _outPartitionElem(StringInfo str, const PartitionElem *node)
35303530
static void
35313531
_outPartitionSpec(StringInfo str, const PartitionSpec *node)
35323532
{
3533-
WRITE_NODE_TYPE("PARTITIONBY");
3533+
WRITE_NODE_TYPE("PARTITIONSPEC");
35343534

35353535
WRITE_STRING_FIELD(strategy);
35363536
WRITE_NODE_FIELD(partParams);
@@ -3540,23 +3540,23 @@ _outPartitionSpec(StringInfo str, const PartitionSpec *node)
35403540
static void
35413541
_outPartitionBoundSpec(StringInfo str, const PartitionBoundSpec *node)
35423542
{
3543-
WRITE_NODE_TYPE("PARTITIONBOUND");
3543+
WRITE_NODE_TYPE("PARTITIONBOUNDSPEC");
35443544

35453545
WRITE_CHAR_FIELD(strategy);
35463546
WRITE_NODE_FIELD(listdatums);
35473547
WRITE_NODE_FIELD(lowerdatums);
35483548
WRITE_NODE_FIELD(upperdatums);
3549-
/* XXX somebody forgot location field; too late to change for v10 */
3549+
WRITE_LOCATION_FIELD(location);
35503550
}
35513551

35523552
static void
35533553
_outPartitionRangeDatum(StringInfo str, const PartitionRangeDatum *node)
35543554
{
3555-
WRITE_NODE_TYPE("PARTRANGEDATUM");
3555+
WRITE_NODE_TYPE("PARTITIONRANGEDATUM");
35563556

35573557
WRITE_BOOL_FIELD(infinite);
35583558
WRITE_NODE_FIELD(value);
3559-
/* XXX somebody forgot location field; too late to change for v10 */
3559+
WRITE_LOCATION_FIELD(location);
35603560
}
35613561

35623562
/*

src/backend/nodes/readfuncs.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2376,8 +2376,7 @@ _readPartitionBoundSpec(void)
23762376
READ_NODE_FIELD(listdatums);
23772377
READ_NODE_FIELD(lowerdatums);
23782378
READ_NODE_FIELD(upperdatums);
2379-
/* XXX somebody forgot location field; too late to change for v10 */
2380-
local_node->location = -1;
2379+
READ_LOCATION_FIELD(location);
23812380

23822381
READ_DONE();
23832382
}
@@ -2392,8 +2391,7 @@ _readPartitionRangeDatum(void)
23922391

23932392
READ_BOOL_FIELD(infinite);
23942393
READ_NODE_FIELD(value);
2395-
/* XXX somebody forgot location field; too late to change for v10 */
2396-
local_node->location = -1;
2394+
READ_LOCATION_FIELD(location);
23972395

23982396
READ_DONE();
23992397
}
@@ -2638,9 +2636,9 @@ parseNodeString(void)
26382636
return_value = _readAlternativeSubPlan();
26392637
else if (MATCH("EXTENSIBLENODE", 14))
26402638
return_value = _readExtensibleNode();
2641-
else if (MATCH("PARTITIONBOUND", 14))
2639+
else if (MATCH("PARTITIONBOUNDSPEC", 18))
26422640
return_value = _readPartitionBoundSpec();
2643-
else if (MATCH("PARTRANGEDATUM", 14))
2641+
else if (MATCH("PARTITIONRANGEDATUM", 19))
26442642
return_value = _readPartitionRangeDatum();
26452643
else
26462644
{

src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/* yyyymmddN */
56-
#define CATALOG_VERSION_NO 201705141
56+
#define CATALOG_VERSION_NO 201705301
5757

5858
#endif

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