Skip to content

[3.2.0] [PostgreSQL]AMDB migration script fails  #9088

@chaminda

Description

@chaminda

Description:

While migrating apim 2.1.0 to 3.2.0, AMDB migration script failed with postgres 9.6
Getting below error.

ERROR:  query string argument of EXECUTE is null
CONTEXT:  PL/pgSQL function inline_code_block line 7 at EXECUTE
SQL state: 22004

Below is the suspicious script section which gives the above error.

DO $$ DECLARE con_name varchar(200);
BEGIN SELECT 'ALTER TABLE IDN_OAUTH2_RESOURCE_SCOPE DROP CONSTRAINT ' || tc .constraint_name || ';' INTO con_name
FROM information_schema.table_constraints AS tc
JOIN information_schema.key_column_usage AS kcu ON tc.constraint_name = kcu.constraint_name
JOIN information_schema.constraint_column_usage AS ccu ON ccu.constraint_name = tc.constraint_name
WHERE constraint_type = 'PRIMARY KEY' AND tc.table_name = 'IDN_OAUTH2_RESOURCE_SCOPE';
EXECUTE con_name;
END $$;

Steps to reproduce:

Run migration step 2.4 (AM DB migration step).

Affected Product Version:

wso2am-3.2.0-rc5

Environment details (with versions):

  • OS: MacOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.2.0DEPRECATED Label; Use Milestone to track version and use Affected/3.2.0 to report issues of 3.2.0Priority/HighestSeverity/BlockerType/Bug

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions