Skip to content

drop function in migration impedes automatic upgrade to latest version #241

@steve-chavez

Description

@steve-chavez

Problem

On an installation that has 0.14.0, upgrading the SQL code with alter extension pg_net update to '0.19.5'; wasn't possible because:

postgres=# alter extension pg_net update to '0.19.5';
ERROR:  cannot drop function net.http_delete(text,jsonb,jsonb,integer) because other objects depend on it
DETAIL:  function my_delete(uuid) depends on function net.http_delete(text,jsonb,jsonb,integer)
HINT:  Use DROP ... CASCADE to drop the dependent objects too.
postgres=# 

This is because of:

drop function net.http_delete (text, jsonb, jsonb, integer);

Solution

Patch the migration so the drop is not necesssary.

Workaround

-- first save the definition of my_delete(uuid), then:
BEGIN;

drop function my_delete(uuid);
alter extension pg_net update to '0.19.5';

create function my_delete(uuid) .. -- use the copied contents here

END;

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions