supabase-community / database-build

In-browser Postgres sandbox with AI assistance (formerly postgres.new)
https://database.build
Apache License 2.0
2.49k stars 197 forks source link

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

Closed jgoux closed 2 months ago

jgoux commented 2 months 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 2 months 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 2 months ago

@gregnr All comments addressed, merging! 🫡