File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -599,8 +599,11 @@ static const SchemaQuery Query_for_list_of_matviews = {
599
599
" OR '\"' || nspname || '\"' ='%s') "
600
600
601
601
#define Query_for_list_of_template_databases \
602
- "SELECT pg_catalog.quote_ident(datname) FROM pg_catalog.pg_database "\
603
- " WHERE substring(pg_catalog.quote_ident(datname),1,%d)='%s' AND datistemplate"
602
+ "SELECT pg_catalog.quote_ident(d.datname) "\
603
+ " FROM pg_catalog.pg_database d "\
604
+ " JOIN pg_catalog.pg_roles r ON r.rolname = CURRENT_USER "\
605
+ " WHERE substring(pg_catalog.quote_ident(d.datname),1,%d)='%s' "\
606
+ " AND (d.datistemplate OR r.rolsuper OR d.datdba = r.oid)"
604
607
605
608
#define Query_for_list_of_databases \
606
609
"SELECT pg_catalog.quote_ident(datname) FROM pg_catalog.pg_database "\
You can’t perform that action at this time.
0 commit comments