public inbox for [email protected]  
help / color / mirror / Atom feed
[PATCH v2] Narrow the scope of the variable outputstr in logicalrep_write_tuple
2+ messages / 2 participants
[nested] [flat]

* [PATCH v2] Narrow the scope of the variable outputstr in logicalrep_write_tuple
@ 2021-01-18 08:04  Japin Li <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Japin Li @ 2021-01-18 08:04 UTC (permalink / raw)

---
 src/backend/replication/logical/proto.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/backend/replication/logical/proto.c b/src/backend/replication/logical/proto.c
index 62275ebabe..f2c85cabb5 100644
--- a/src/backend/replication/logical/proto.c
+++ b/src/backend/replication/logical/proto.c
@@ -493,7 +493,6 @@ logicalrep_write_tuple(StringInfo out, Relation rel, HeapTuple tuple, bool binar
 		HeapTuple	typtup;
 		Form_pg_type typclass;
 		Form_pg_attribute att = TupleDescAttr(desc, i);
-		char	   *outputstr;
 
 		if (att->attisdropped || att->attgenerated)
 			continue;
@@ -537,6 +536,8 @@ logicalrep_write_tuple(StringInfo out, Relation rel, HeapTuple tuple, bool binar
 		}
 		else
 		{
+			char	   *outputstr;
+
 			pq_sendbyte(out, LOGICALREP_COLUMN_TEXT);
 			outputstr = OidOutputFunctionCall(typclass->typoutput, values[i]);
 			pq_sendcountedtext(out, outputstr, strlen(outputstr), false);
-- 
2.30.0


--=-=-=--





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pg16: XX000: could not find pathkey item to sort
@ 2023-09-18 14:02  Justin Pryzby <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Justin Pryzby @ 2023-09-18 14:02 UTC (permalink / raw)
  To: [email protected]; +Cc: David Rowley <[email protected]>

This fails since 1349d2790b

commit 1349d2790bf48a4de072931c722f39337e72055e
Author: David Rowley <[email protected]>
Date:   Tue Aug 2 23:11:45 2022 +1200

    Improve performance of ORDER BY / DISTINCT aggregates

ts=# CREATE TABLE t (a int, b text) PARTITION BY RANGE (a);
ts=# CREATE TABLE td PARTITION OF t DEFAULT;
ts=# INSERT INTO t SELECT 1 AS a, '' AS b;
ts=# SET enable_partitionwise_aggregate=on;
ts=# explain SELECT a, COUNT(DISTINCT b) FROM t GROUP BY a;
ERROR:  XX000: could not find pathkey item to sort
LOCATION:  prepare_sort_from_pathkeys, createplan.c:6235

-- 
Justin






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2023-09-18 14:02 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18 08:04 [PATCH v2] Narrow the scope of the variable outputstr in logicalrep_write_tuple Japin Li <[email protected]>
2023-09-18 14:02 pg16: XX000: could not find pathkey item to sort Justin Pryzby <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox