supabase-community / postgres-new

In-browser Postgres sandbox with AI assistance
https://database.build
Apache License 2.0
2.34k stars 183 forks source link

Fix pg_dump for databases created with PGlite < v0.2.9 #105

Closed jgoux closed 3 weeks ago

jgoux commented 3 weeks ago

I implemented a "middleware" which :

The two queries we're interested in are:

I looked at pg_dump code from v15 to v17 and the queries definitions are the same across all these versions so we can safely detect them.

The logic is:

Once pg_dump receives an oid > 16384 for the extensions, it will print the CREATE EXTENSION statements in the dump.

If we use pg_dump to migrate people to the new domain, we will be able to delete this middleware as everyone will be on a patched version of PGlite. 👍

vercel[bot] commented 3 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
postgres-new ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 1, 2024 8:05am
jgoux commented 3 weeks ago

@gregnr All comments addressed, merging! 🫡