Re: [REVIEW] Tab Completion for CREATE DATABASE ... TEMPLATE ... - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [REVIEW] Tab Completion for CREATE DATABASE ... TEMPLATE ...
Date
Msg-id 21272.1473684928@sss.pgh.pa.us
Whole thread Raw
In response to Re: [REVIEW] Tab Completion for CREATE DATABASE ... TEMPLATE ...  (Kevin Grittner <kgrittn@gmail.com>)
Responses Re: [REVIEW] Tab Completion for CREATE DATABASE ... TEMPLATE ...
List pgsql-hackers
Kevin Grittner <kgrittn@gmail.com> writes:
> But that gives incorrect results for the case I asked about earlier
> on the thread, while the query I pushed gives correct results:

AFAICS, my query gives correct results for that case.  bob is permitted
to copy fred's databases db1 and postgres, or would be if he had createdb
privileges.  The query you committed is flat wrong, because it doesn't
account for database ownership being granted via role membership.

> There is absolutely no question that the query you suggest is
> wrong;

Please provide some evidence of that.

> the only case I had to think about very hard after
> establishing that CREATEDB was not inherited was when bob owned a
> database but did not have CREATEDB permission.

I agree that we should not look at createdb here.  If we did, the
effect would be that for a user without createdb, psql would refuse
to offer any completions, which seems more confusing than helpful.
(If it were the tab completion's code to enforce that, which it isn't,
surely it should have complained much earlier in the command.)
        regards, tom lane



pgsql-hackers by date:

Previous
From: Vitaly Burovoy
Date:
Subject: Re: [REVIEW] Tab Completion for CREATE DATABASE ... TEMPLATE ...
Next
From: Kevin Grittner
Date:
Subject: Re: [REVIEW] Tab Completion for CREATE DATABASE ... TEMPLATE ...