Fix pg_dump for databases created with PGlite < v0.2.9 #105
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I implemented a "middleware" which :
pg_dumpinitiated a connection through theapplication_name=pg_dumpin the Startup message.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:
vectorextension and then patch it (using the oid 99999)vectorextension oid for a search/replace purpose.Once pg_dump receives an
oid > 16384for the extensions, it will print theCREATE EXTENSIONstatements in the dump.If we use
pg_dumpto migrate people to the new domain, we will be able to delete this middleware as everyone will be on a patched version of PGlite. 👍