Skip to content

Add support for extending character varying limit - #162

Merged
OJFord merged 2 commits into
fix-copfrom
extend-varchar-limit
Oct 8, 2026
Merged

OJFord merged 2 commits into
fix-copfrom
extend-varchar-limit

Conversation

@OJFord

@OJFord OJFord commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

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 columns 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.

OJFord added 2 commits October 8, 2026 13:22
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
OJFord force-pushed the extend-varchar-limit branch from 8302291 to f11737f Compare October 8, 2026 12:22
@OJFord
OJFord changed the base branch from master to fix-cop October 8, 2026 12:24
@OJFord
OJFord added this pull request to stack #164 October 8, 2026 12:24
@OJFord
OJFord merged commit 6adf37b into master Oct 8, 2026
10 checks passed
@OJFord
OJFord deleted the extend-varchar-limit branch October 8, 2026 14:58
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.

2 participants