Repository navigation
Add support for extending character varying limit - #162
Merged
Merged
Conversation
Since [Postgres 9.2], increasing the limit of `varchar` columns is a metadata change only, no longer requiring a table rewrite. (Ditto `numeric`'s precision, `timestamp`, and similar.) Thus, provided the limit is increased or removed, we can safely create migrations that `alter column`s of `type varchar`. Here, `extend_varchar_column_limit` is introduced to do exactly that, with the expected current limit passed in for compile-time validation of widening as well as migration-time check that it truly matches. [Postgres 9.2]: https://www.postgresql.org/docs/release/9.2.0/
OJFord
force-pushed
the
extend-varchar-limit
branch
from
October 8, 2026 12:22
8302291 to
f11737f
Compare
OJFord
added this pull request to stack #164
October 8, 2026 12:24
chloeverity
approved these changes
Oct 8, 2026
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.
Since Postgres 9.2, increasing the limit of
varcharcolumns is ametadata change only, no longer requiring a table rewrite. (Ditto
numeric's precision,timestamp, and similar.)Thus, provided the limit is increased or removed, we can safely create
migrations that
alter columns oftype varchar.Here,
extend_varchar_column_limitis introduced to do exactly that,with the expected current limit passed in for compile-time validation
of widening as well as migration-time check that it truly matches.