Skip to content

Conversation

@nrdvana
Copy link
Contributor

@nrdvana nrdvana commented Nov 3, 2025

Postgres 8 and later require a C<< USING expression >> clause when changing the type of a column in a potentially lossy manner, such as from C to C.

This change adds an automatic "USING (colname::datatype)" suffix any time the data type has changed, which should be a safe default. It is also conditioned on the version of Postgres, but also makes it the default in absence of a version, since Pg 8 is so old.

@nrdvana nrdvana force-pushed the postgresql_coltype_change_using branch from cd9af18 to 7248f4a Compare November 3, 2025 16:31
Postgres 8 and later require a `USING expression` clause when
changing the type of a column in a potentially lossy manner, such
as from C<text> to C<numeric>.

This change adds an automatic `USING (colname::datatype)` suffix
any time the data type has changed, which should be a safe default.
It is also conditioned on the version of Postgres, but also makes
it the default in absence of a version, since Pg 8 is so old.
@nrdvana nrdvana force-pushed the postgresql_coltype_change_using branch from 7248f4a to 3441853 Compare November 3, 2025 16:33
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.

1 participant