You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I spent some time under the hood on this, and it seems like pglite/pg-gateway is sending back an extra, unexpected Ready for Query message when replying to Parse or Bind messages. After adding a bunch of logging, this was the problematic message exchange:
Atlas:
Send Parse message
Send Describe message
Send Sync message
______________________________
Backend:
Send ParseComplete message:
1\u0000\u0000\u0000\u0004
Send Ready for Query message: // This one seems unexpected
Z\u0000\u0000\u0000\u0005I"
Send Parameter description message:
"t\u0000\u0000\u0000\n\u0000\u0001\u0000\u0000\u0000\u0013
Send Row description message:
T\u0000\u0000\u0000>O <omitted for length>
Send Ready for query message
Z\u0000\u0000\u0000\u0005I"
_____________________________
Atlas consume consumes ParseComplete.
Atlas tries to consume Parameter Description message, and errors when it instead sees a Ready for Query instead
I'm pretty stumped at this point, and was hoping someone with a better grasp of the wire protocol can explain why this isn't working as expected.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
From the pglite example, start up the server with npm run dev
Thanks for reporting @joehan! This sounds like the exact same issue as #4. We identified this as a problem with PGlite during the extended query protocol (tracked here).
The ElectricSQL team is aware of the problem and currently working on a fix. In the meantime the only other solution could be to add custom logic that omits the incorrect ReadyForQuery messages, but only during an extended query flow.
Bug report
Describe the bug
I have a basic server set up (similar to https://github.com/supabase-community/pg-gateway?tab=readme-ov-file#pglite), and I'm trying to use Atlas to migrate the schema of my database. However, when I do run:
I get
I spent some time under the hood on this, and it seems like pglite/pg-gateway is sending back an extra, unexpected Ready for Query message when replying to Parse or Bind messages. After adding a bunch of logging, this was the problematic message exchange:
I'm pretty stumped at this point, and was hoping someone with a better grasp of the wire protocol can explain why this isn't working as expected.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
npm run dev
curl -sSf https://atlasgo.sh | sh
atlas schema inspect --url "postgres://:5432/postgres?search_path=public&sslmode=disable"
Expected behavior
Atlas successfully queries pglite and plans a migration.
System information
The text was updated successfully, but these errors were encountered: