Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit63c1a87

Browse files
committed
Fix recent commit for tab-completion of database template.
The details of commit5280309 werebased on a misunderstanding of the role inheritance allowing useof a database for a template. While the CREATEDB privilege is notinherited, the database ownership is privileges are.Pointed out by Vitaly Burovoy and Tom Lane.Fix provided by Tom Lane, reviewed by Vitaly Burovoy.
1 parent4068eb9 commit63c1a87

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

‎src/bin/psql/tab-complete.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,9 +601,8 @@ static const SchemaQuery Query_for_list_of_matviews = {
601601
#defineQuery_for_list_of_template_databases \
602602
"SELECT pg_catalog.quote_ident(d.datname) "\
603603
" FROM pg_catalog.pg_database d "\
604-
" JOIN pg_catalog.pg_roles r ON r.rolname = CURRENT_USER "\
605604
" WHERE substring(pg_catalog.quote_ident(d.datname),1,%d)='%s' "\
606-
" AND (d.datistemplate ORr.rolsuper ORd.datdba = r.oid)"
605+
" AND (d.datistemplate ORpg_catalog.pg_has_role(d.datdba, 'USAGE'))"
607606

608607
#defineQuery_for_list_of_databases \
609608
"SELECT pg_catalog.quote_ident(datname) FROM pg_catalog.pg_database "\

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp