Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix pg_namespace emulation #5594

Merged
merged 3 commits into from Jun 5, 2023
Merged

Fix pg_namespace emulation #5594

merged 3 commits into from Jun 5, 2023

Conversation

elprans
Copy link
Member

@elprans elprans commented Jun 5, 2023

Current emulation of pg_namespace is somewhat broken because it
returns NULL for tableoid for synthesized schemes, which throws off
catalog map logic in pg_dump of PostgreSQL 15. Emit OID of
pg_namespace correctly instead. While at it, set xmin, xmax,
cmin, cmax to non-NULL values as well. ctid is harder to
emulate correctly so leave it as NULL.

Current emulation of `pg_namespace` is somewhat broken because it
returns `NULL` for `tableoid` for synthesized schemes, which throws off
catalog map logic in `pg_dump` of PostgreSQL 15.  Emit OID of
`pg_namespace` correctly instead.  While at it, set `xmin`, `xmax`,
`cmin`, `cmax` to non-`NULL` values as well.  `ctid` is harder to
emulate correctly so leave it as `NULL`.
Copy link
Contributor

@aljazerzen aljazerzen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was foolish enough to think that no software would use these.

pg_dump really is the ultimate test suite for Postgres compatibility.

@elprans
Copy link
Member Author

elprans commented Jun 5, 2023

Hmm, I think this also needs to be backported as a metaschema patch.

@elprans elprans merged commit 7dee3b2 into master Jun 5, 2023
21 checks passed
@elprans elprans deleted the pg_namespace branch June 5, 2023 19:50
msullivan pushed a commit that referenced this pull request Jun 9, 2023
Current emulation of `pg_namespace` is somewhat broken because it
returns `NULL` for `tableoid` for synthesized schemes, which throws off
catalog map logic in `pg_dump` of PostgreSQL 15.  Emit OID of
`pg_namespace` correctly instead.  While at it, set `xmin`, `xmax`,
`cmin`, `cmax` to non-`NULL` values as well.  `ctid` is harder to
emulate correctly so leave it as `NULL`.

Backport note: this needs a patch to work on older installs, but I'm
skipping the patch for now and letting it get picked up by a pending
one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants