docs(pg): correct generated-column limitations per issue #608#690
Open
sanjibani wants to merge 1 commit into
Open
docs(pg): correct generated-column limitations per issue #608#690sanjibani wants to merge 1 commit into
sanjibani wants to merge 1 commit into
Conversation
…#608 Signed-off-by: sanjibani <18418553+sanjibani@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The PostgreSQL generated-columns page lists "Cannot directly use in primary keys, foreign keys, or unique constraints" as a limitation. That is incorrect for stored generated columns: they can be used in PK, FK, and UNIQUE constraints as long as the column is NOT NULL. The known limit is that a generated column cannot be a partition key.
Fixes #608.
Verified against the PostgreSQL 17 docs (https://www.postgresql.org/docs/current/ddl-generated-columns.html) and a minimal repro (PR description in #608):
Both CREATE TABLE statements succeed. The old limitation is removed; the partition-key limit is the only remaining constraint worth calling out at the same level.
Scope: 1 line in 1 file. The cockroach-generated-columns page has the same line, but Cockroach's behavior is not the topic of #608 — leaving the cockroach copy alone to keep the change scoped.
No em-dash.