Open joehan opened 1 week ago
Thanks for reporting @joehan! This sounds like the exact same issue as https://github.com/supabase-community/pg-gateway/issues/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.
Thanks so much for the quick reply, glad to see I'm not going crazy 😅 I'll keep an eye on https://github.com/electric-sql/pglite/issues/223 for the fix.
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