psql tab completion for CREATE DATABASE ... TEMPLATE ...
Sehrope Sarkuni, reviewed by Merlin Moncure & Vitaly Burovoy with some editing by me
This commit is contained in:
parent
40b449ae84
commit
52803098ab
@ -599,8 +599,11 @@ static const SchemaQuery Query_for_list_of_matviews = {
|
|||||||
" OR '\"' || nspname || '\"' ='%s') "
|
" OR '\"' || nspname || '\"' ='%s') "
|
||||||
|
|
||||||
#define Query_for_list_of_template_databases \
|
#define Query_for_list_of_template_databases \
|
||||||
"SELECT pg_catalog.quote_ident(datname) FROM pg_catalog.pg_database "\
|
"SELECT pg_catalog.quote_ident(d.datname) "\
|
||||||
" WHERE substring(pg_catalog.quote_ident(datname),1,%d)='%s' AND datistemplate"
|
" FROM pg_catalog.pg_database d "\
|
||||||
|
" JOIN pg_catalog.pg_roles r ON r.rolname = CURRENT_USER "\
|
||||||
|
" WHERE substring(pg_catalog.quote_ident(d.datname),1,%d)='%s' "\
|
||||||
|
" AND (d.datistemplate OR r.rolsuper OR d.datdba = r.oid)"
|
||||||
|
|
||||||
#define Query_for_list_of_databases \
|
#define Query_for_list_of_databases \
|
||||||
"SELECT pg_catalog.quote_ident(datname) FROM pg_catalog.pg_database "\
|
"SELECT pg_catalog.quote_ident(datname) FROM pg_catalog.pg_database "\
|
||||||
|
Loading…
x
Reference in New Issue
Block a user