Skip to content

Explicitly specify PG client protocol#4467

Merged
pfcoperez merged 2 commits into
mainfrom
remove-pinned-versions/pgx
Jun 22, 2026
Merged

Explicitly specify PG client protocol#4467
pfcoperez merged 2 commits into
mainfrom
remove-pinned-versions/pgx

Conversation

@pfcoperez

@pfcoperez pfcoperez commented Jun 22, 2026

Copy link
Copy Markdown
Member

With this, it's safe to unpin jackc/pgx dependency and bump its version which is also done in the same PR.

The selected protocol version is 3.0 which is he one we were selecting by default values with the pinned version:

https://github.com/jackc/pgx/blob/4e4eaedb47b7b3cfba0a1b0a9e6a3f015764f046/pgconn/config.go#L472-L474

With the dependency update, the way of decoding macaddr fields is updated to more recent client library versions, concretely after: jackc/pgx@08c9bb1

According to that change, it was a bug to rely on Stringer representation for composite types as macaddr.
The changes in this PR do precisely that, move back to using the stringer interface in the type conversion: e4b97ab

With this, it's safe to unpin `jackc/pgx` dependency and bump its version
@pfcoperez pfcoperez requested a review from a team as a code owner June 22, 2026 09:57
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
2318 2 2316 211
View the top 2 failed test(s) by shortest run time
github.com/PeerDB-io/peerdb/flow/connectors/postgres::TestStringDataTypes
Stack Traces | 0s run time
=== RUN   TestStringDataTypes
=== PAUSE TestStringDataTypes
=== CONT  TestStringDataTypes
2026/06/22 10:06:26 INFO generated partitions for child tables flowName=testOffsetBounds numPartitions=8 blocksPerPartition=20 totalBlocks=155
--- FAIL: TestStringDataTypes (0.00s)
2026/06/22 10:06:27 INFO using partition function flowName=testGrouping partitionFunc=CTIDBlockPartitioningFunc
2026/06/22 10:06:27 INFO child tables detected flowName=testGrouping table="\"test_n0vhb98c\".\"many_children\"" numChildTables=20 totalBlocks=20
2026/06/22 10:06:27 INFO generated partitions for child tables flowName=testGrouping numPartitions=7 blocksPerPartition=3 totalBlocks=20
github.com/PeerDB-io/peerdb/flow/connectors/postgres::TestStringDataTypes/macaddr
Stack Traces | 0.1s run time
=== RUN   TestStringDataTypes/macaddr
=== PAUSE TestStringDataTypes/macaddr
=== CONT  TestStringDataTypes/macaddr
2026/06/22 10:06:26 INFO using partition function flowName=testCTIDPartitioned partitionFunc=CTIDBlockPartitioningFunc
2026/06/22 10:06:26 INFO Executing and processing query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_empty_tstzrange_1782122786\".test"
2026/06/22 10:06:26 INFO Executing and processing query stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_empty_tstzrange_1782122786\".test"
2026/06/22 10:06:26 INFO Executing and processing query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_empty_tsrange_1782122786\".test"
2026/06/22 10:06:26 INFO Executing and processing query stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_empty_tsrange_1782122786\".test"
2026/06/22 10:06:26 INFO [pg_query_executor] declared cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" cursorQuery="DECLARE peerdb_cursor_1628267249727235703 CURSOR FOR SELECT * FROM \"qrep_query_executor_empty_tstzrange_1782122786\".test" args=[]
2026/06/22 10:06:26 INFO [pg_query_executor] fetching rows start x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_empty_tstzrange_1782122786\".test" channelLen=0
2026/06/22 10:06:26 INFO [pg_query_executor] declared cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" cursorQuery="DECLARE peerdb_cursor_8717897767263065740 CURSOR FOR SELECT * FROM \"qrep_query_executor_empty_tsrange_1782122786\".test" args=[]
2026/06/22 10:06:26 INFO [pg_query_executor] fetching rows start x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_empty_tsrange_1782122786\".test" channelLen=0
2026/06/22 10:06:26 WARN unsupported field type x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} oid=3910 typeName=tstzrange mapping=string
2026/06/22 10:06:26 WARN unsupported field type x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} oid=3911 typeName=_tstzrange mapping=array_string
2026/06/22 10:06:26 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" cursor=peerdb_cursor_1628267249727235703
2026/06/22 10:06:26 WARN unsupported field type x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} oid=3908 typeName=tsrange mapping=string
2026/06/22 10:06:26 WARN unsupported field type x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} oid=3909 typeName=_tsrange mapping=array_string
2026/06/22 10:06:26 INFO Executing and processing query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_tstzrange_1782122786\".test"
2026/06/22 10:06:26 INFO Executing and processing query stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_tstzrange_1782122786\".test"
2026/06/22 10:06:26 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" cursor=peerdb_cursor_1628267249727235703 records=1 bytes=31 channelLen=0
2026/06/22 10:06:26 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_empty_tstzrange_1782122786\".test" rows=1 bytes=31 channelLen=0
2026/06/22 10:06:26 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" cursor=peerdb_cursor_1628267249727235703
2026/06/22 10:06:26 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" cursor=peerdb_cursor_1628267249727235703 records=0 bytes=0 channelLen=0
2026/06/22 10:06:26 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_empty_tstzrange_1782122786\".test" rows=0 bytes=0 channelLen=0
2026/06/22 10:06:26 INFO [pg_query_executor] committing transaction x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part"
2026/06/22 10:06:26 INFO [pg_query_executor] committed transaction for query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_empty_tstzrange_1782122786\".test" rows=1 bytes=31 channelLen=0
2026/06/22 10:06:26 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" cursor=peerdb_cursor_8717897767263065740
2026/06/22 10:06:26 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" cursor=peerdb_cursor_8717897767263065740 records=1 bytes=31 channelLen=0
2026/06/22 10:06:26 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_empty_tsrange_1782122786\".test" rows=1 bytes=31 channelLen=0
2026/06/22 10:06:26 INFO [pg_query_executor] fetching from cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" cursor=peerdb_cursor_8717897767263065740
2026/06/22 10:06:26 INFO processed row stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" cursor=peerdb_cursor_8717897767263065740 records=0 bytes=0 channelLen=0
2026/06/22 10:06:26 INFO [pg_query_executor] fetched rows x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_empty_tsrange_1782122786\".test" rows=0 bytes=0 channelLen=0
2026/06/22 10:06:26 INFO [pg_query_executor] committing transaction x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part"
2026/06/22 10:06:26 INFO child tables detected flowName=testCTIDPartitioned table="\"test_nwtgoe8h\".\"partitioned_test\"" numChildTables=4 totalBlocks=4
2026/06/22 10:06:26 INFO generated partitions for child tables flowName=testCTIDPartitioned numPartitions=4 blocksPerPartition=1 totalBlocks=4
2026/06/22 10:06:26 INFO [pg_query_executor] committed transaction for query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_empty_tsrange_1782122786\".test" rows=1 bytes=31 channelLen=0
2026/06/22 10:06:26 INFO [pg_query_executor] declared cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" cursorQuery="DECLARE peerdb_cursor_12421660074502653102 CURSOR FOR SELECT * FROM \"qrep_query_executor_tstzrange_1782122786\".test" args=[]
2026/06/22 10:06:26 INFO [pg_query_executor] fetching rows start x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_tstzrange_1782122786\".test" channelLen=0
    qrep_query_executor_test.go:692: 
        	Error Trace:	.../connectors/postgres/qrep_query_executor_test.go:692
        	Error:      	Not equal: 
        	            	expected: []string{"08:00:2b:01:02:03", "08:00:2b:01:02:04", ""}
        	            	actual  : []string{"\b\x00+\x01\x02\x03", "\b\x00+\x01\x02\x04", ""}
        	            	
        	            	Diff:
2026/06/22 10:06:26 INFO Executing and processing query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_line_1782122786\".test"
2026/06/22 10:06:26 INFO Executing and processing query stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_line_1782122786\".test"
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1,4 +1,4 @@
        	            	 ([]string) (len=3) {
        	            	- (string) (len=17) "08:00:2b:01:02:03",
2026/06/22 10:06:26 INFO [pg_query_executor] declared cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" cursorQuery="DECLARE peerdb_cursor_316590033656802827 CURSOR FOR SELECT * FROM \"qrep_query_executor_line_1782122786\".test" args=[]
2026/06/22 10:06:26 INFO [pg_query_executor] fetching rows start x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_line_1782122786\".test" channelLen=0
        	            	- (string) (len=17) "08:00:2b:01:02:04",
        	            	+ (string) (len=6) "\b\x00+\x01\x02\x03",
        	            	+ (string) (len=6) "\b\x00+\x01\x02\x04",
        	            	  (string) ""
        	Test:       	TestStringDataTypes/macaddr
--- FAIL: TestStringDataTypes/macaddr (0.10s)
2026/06/22 10:06:27 INFO [pg_query_executor] committed transaction for query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_path_1782122786\".test" rows=1 bytes=191 channelLen=0
2026/06/22 10:06:27 INFO Executing and processing query x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_circle_1782122786\".test"
2026/06/22 10:06:27 INFO Executing and processing query stream x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_circle_1782122786\".test"
2026/06/22 10:06:27 INFO [pg_query_executor] declared cursor x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" cursorQuery="DECLARE peerdb_cursor_9827836493522974373 CURSOR FOR SELECT * FROM \"qrep_query_executor_circle_1782122786\".test" args=[]
2026/06/22 10:06:27 INFO [pg_query_executor] fetching rows start x-peerdb-additional-metadata={Operation:FLOW_OPERATION_UNKNOWN} partitionId="test part" query="SELECT * FROM \"qrep_query_executor_circle_1782122786\".test" channelLen=0

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@github-actions

Copy link
Copy Markdown
Contributor

❌ Test Failure

Analysis: Deterministic failure in TestStringDataTypes/macaddr reproduced identically across all three matrix jobs: switching to the binary PG client protocol (the PR's purpose) makes macaddr decode as raw 6 bytes instead of canonical text, so it's a real bug, not flaky.
Confidence: 0.96

⚠️ This appears to be a real bug - manual intervention needed

View workflow run

@pfcoperez

Copy link
Copy Markdown
Member Author

Interesting, even fixing the protocol leads to changes at:

=== FAIL: connectors/postgres TestStringDataTypes/macaddr (0.10s)
2026/06/22 10:04:58 INFO using partition function flowName=testMultiLevelInherited partitionFunc=CTIDBlockPartitioningFunc
2026/06/22 10:04:58 INFO Executing and processing query x-peerdb-additional-metadata=***Operation:FLOW_OPERATION_UNKNOWN*** partitionId="test part" query="SELECT * FROM \"qrep_query_executor_tsrange_1782122698\".test"
2026/06/22 10:04:58 INFO Executing and processing query stream x-peerdb-additional-metadata=***Operation:FLOW_OPERATION_UNKNOWN*** partitionId="test part" query="SELECT * FROM \"qrep_query_executor_tsrange_1782122698\".test"
2026/06/22 10:04:58 INFO Executing and processing query x-peerdb-additional-metadata=***Operation:FLOW_OPERATION_UNKNOWN*** partitionId="test part" query="SELECT * FROM \"qrep_query_executor_tstzrange_1782122698\".test"
2026/06/22 10:04:58 INFO Executing and processing query stream x-peerdb-additional-metadata=***Operation:FLOW_OPERATION_UNKNOWN*** partitionId="test part" query="SELECT * FROM \"qrep_query_executor_tstzrange_1782122698\".test"

Taking a peek.

@claude

claude Bot commented Jun 22, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@pfcoperez pfcoperez merged commit 93773a9 into main Jun 22, 2026
16 checks passed
@pfcoperez pfcoperez deleted the remove-pinned-versions/pgx branch June 22, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants