Skip to content

fix: reject portal based queries in pipeline mode instead of TypeError - #3737

Merged
brianc merged 1 commit into
brianc:masterfrom
nigrosimone:reject-portal-queries-in-pipeline
Aug 12, 2026
Merged

fix: reject portal based queries in pipeline mode instead of TypeError#3737
brianc merged 1 commit into
brianc:masterfrom
nigrosimone:reject-portal-queries-in-pipeline

Conversation

@nigrosimone

@nigrosimone nigrosimone commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

A portal stays open across more round trips. In pipeline mode the queries behind it are written without waiting, so the server answer them out of that portal: the rows go to the wrong query, the next read fails with portal "..." does not exist, and with pg-cursor the process dies with an uncaught TypeError: Cannot read properties of null (reading 'push') inside handleDataRow.

Two cases, both reproducible every time on a client with pipeline: true:

without cursor 1,2,3   (correct)
with cursor:   TypeError: Cannot read properties of null (reading 'push')
               at Cursor.handleDataRow (pg-cursor/index.js:116)

@nigrosimone
nigrosimone force-pushed the reject-portal-queries-in-pipeline branch from 8316f6f to 7e175a8 Compare August 9, 2026 11:58
@nigrosimone
nigrosimone marked this pull request as ready for review August 9, 2026 12:03
@nigrosimone nigrosimone changed the title Reject portal based queries in pipeline mode instead of misrouting rows fix: reject portal based queries in pipeline mode instead of misrouting rows Aug 10, 2026
@nigrosimone nigrosimone changed the title fix: reject portal based queries in pipeline mode instead of misrouting rows fix: reject portal based queries in pipeline mode instead of TypeError Aug 10, 2026

@brianc brianc left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is cool - yeah its kinda unfortunate pipeline mode prevents some other stuff but it also makes sense. pipeline is "make the fast & straight forward things faster" and cursors or streams are "make the fiddly pieces easier for node to deal with"

@brianc
brianc merged commit 0cef6af into brianc:master Aug 12, 2026
12 checks passed
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