-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Describe the bug
Incompatible cast does not result in DROP COLUMN followed by ADD COLUMN.
This is occurring for me with all hazards allowed and plan validation disabled.
Error: executing migration statement. the database maybe be in a dirty state:
{ALTER TABLE "public"."activity" ALTER COLUMN "ts" SET DATA TYPE timestamp with
time zone using "ts"::timestamp with time zone 3s 3s
[ACQUIRES_ACCESS_EXCLUSIVE_LOCK: This will completely lock the table while the data
is being re-written. The duration of this conversion depends on if the type conversion
is trivial or not. A non-trivial conversion will require a table rewrite. A trivial
conversion is one where the binary values are coercible and the column contents are not
changing.]}:
ERROR: cannot cast type integer to timestamp with time zone (SQLSTATE 42846)
Expected behavior
DROP then ADD
To Reproduce
Change a column type from integer
to timestamptz
.
Context
pg-schema-diff version: 5fe8259
pg-schema-diff usage: CLI
Postgres version: 14
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers