pgschema icon indicating copy to clipboard operation
pgschema copied to clipboard

Changing the type of a function must drop it before creating the new one

Open ludat opened this issue 9 months ago • 0 comments

Old schema:

CREATE OR REPLACE FUNCTION somefunction(
    param1 text
)
[...]

New schema:

CREATE OR REPLACE FUNCTION somefunction(
    param2 uuid
)
[...]

Generated migration:

CREATE OR REPLACE FUNCTION somefunction(
    param2 uuid
)

Which results in the migration failing since postgres disallows changing types of params of functions, the migration should first drop the old function before creating the new one. This also includes the return type.

ludat avatar Feb 26 '26 05:02 ludat