Fix the dependents SQL of Roles which is throwing a type casting error on PostgreSQL 15. #6093

pull/6112/head
Aditya Toshniwal 2023-04-10 12:25:12 +05:30 committed by GitHub
parent 96450fee63
commit 15914fe5e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -21,13 +21,13 @@ WHERE cl.oid IN (SELECT objid FROM pg_catalog.pg_shdepend WHERE refobjid={{rid}}
UNION ALL SELECT 'n', null, nspname, null
FROM pg_catalog.pg_namespace nsp
WHERE nsp.oid IN (SELECT objid FROM pg_catalog.pg_shdepend WHERE refobjid={{rid}}::oid) AND nsp.oid > {{lastsysoid}}::oid
UNION ALL SELECT CASE WHEN typtype='d' THEN 'd' ELSE 'y' END, null, typname, null
UNION ALL SELECT CASE WHEN typtype='d' THEN 'd'::"char" ELSE 'y'::"char" END, null, typname, null
FROM pg_catalog.pg_type ty
WHERE ty.oid IN (SELECT objid FROM pg_catalog.pg_shdepend WHERE refobjid={{rid}}::oid) AND ty.oid > {{lastsysoid}}::oid
UNION ALL SELECT 'C', null, conname, null
FROM pg_catalog.pg_conversion co
WHERE co.oid IN (SELECT objid FROM pg_catalog.pg_shdepend WHERE refobjid={{rid}}::oid) AND co.oid > {{lastsysoid}}::oid
UNION ALL SELECT CASE WHEN prorettype=2279 THEN 'T' ELSE 'p' END, null, proname, null
UNION ALL SELECT CASE WHEN prorettype=2279 THEN 'T'::"char" ELSE 'p'::"char" END, null, proname, null
FROM pg_catalog.pg_proc pr
WHERE pr.oid IN (SELECT objid FROM pg_catalog.pg_shdepend WHERE refobjid={{rid}}::oid) AND pr.oid > {{lastsysoid}}::oid
UNION ALL SELECT 'o', null, oprname || '('::text || COALESCE(tl.typname, ''::text) || CASE WHEN tl.oid IS NOT NULL