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_constraint oid duplication #8166

Merged
merged 1 commit into from
Jan 3, 2025
Merged

Fix pg_constraint oid duplication #8166

merged 1 commit into from
Jan 3, 2025

Conversation

msullivan
Copy link
Member

Multiple of our invested constraints were being given the same oid
which caused problems.

One specific problem was generating bogus pgdumps, which annoyingly
mostly only showed up in inplace-upgrade tests:
https://github.com/edgedb/edgedb/actions/runs/12442350513/job/34740389082?pr=8159

The problem was that pg_get_constraintdef was returning a constraint
definition for the "wrong" object; the defining query would return 3
rows, and postgres silently returns the first.

Fix this by adding some bits to the oid separate from the uuid of the
link, and test that the fix works by putting the body of
pg_get_constraintdef into a subquery.

This hopefully will unblock #8159.

Multiple of our invested constraints were being given the same oid
which caused problems.

One specific problem was generating bogus pgdumps, which annoyingly
mostly only showed up in inplace-upgrade tests:
https://github.com/edgedb/edgedb/actions/runs/12442350513/job/34740389082?pr=8159

The problem was that pg_get_constraintdef was returning a constraint
definition for the "wrong" object; the defining query would return 3
rows, and postgres silently returns the first.

Fix this by adding some bits to the oid separate from the uuid of the
link, and test that the fix works by putting the body of
pg_get_constraintdef into a subquery.

This hopefully will unblock #8159.
@msullivan msullivan added the to-backport-6.x PRs that *should* be backported to 6.x label Jan 2, 2025
@msullivan msullivan merged commit 0bbb4e6 into master Jan 3, 2025
23 checks passed
@msullivan msullivan deleted the fix-pg_constraint branch January 3, 2025 00:14
msullivan added a commit that referenced this pull request Jan 3, 2025
Multiple of our invested constraints were being given the same oid
which caused problems.

One specific problem was generating bogus pgdumps, which annoyingly
mostly only showed up in inplace-upgrade tests:

https://github.com/edgedb/edgedb/actions/runs/12442350513/job/34740389082?pr=8159

The problem was that pg_get_constraintdef was returning a constraint
definition for the "wrong" object; the defining query would return 3
rows, and postgres silently returns the first.

Fix this by adding some bits to the oid separate from the uuid of the
link, and test that the fix works by putting the body of
pg_get_constraintdef into a subquery.

This hopefully will unblock #8159.
msullivan added a commit that referenced this pull request Jan 3, 2025
Multiple of our invested constraints were being given the same oid
which caused problems.

One specific problem was generating bogus pgdumps, which annoyingly
mostly only showed up in inplace-upgrade tests:


https://github.com/edgedb/edgedb/actions/runs/12442350513/job/34740389082?pr=8159

The problem was that pg_get_constraintdef was returning a constraint
definition for the "wrong" object; the defining query would return 3
rows, and postgres silently returns the first.

Fix this by adding some bits to the oid separate from the uuid of the
link, and test that the fix works by putting the body of
pg_get_constraintdef into a subquery.

This hopefully will unblock #8159.
@msullivan msullivan added backported-6.x PRs that *have* been backported to 6.x and removed to-backport-6.x PRs that *should* be backported to 6.x labels Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported-6.x PRs that *have* been backported to 6.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants