Re: [REVIEW] Tab Completion for CREATE DATABASE ... TEMPLATE ...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kevin Grittner <kgrittn(at)gmail(dot)com>
Cc: Vitaly Burovoy <vitaly(dot)burovoy(at)gmail(dot)com>, Sehrope Sarkuni <sehrope(at)jackdb(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [REVIEW] Tab Completion for CREATE DATABASE ... TEMPLATE ...
Date: 2016-09-12 12:55:28
Message-ID: 21272.1473684928@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Kevin Grittner <kgrittn(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2016-09-12 13:14:26 Re: [REVIEW] Tab Completion for CREATE DATABASE ... TEMPLATE ...
Previous Message Vitaly Burovoy 2016-09-12 12:53:06 Re: [REVIEW] Tab Completion for CREATE DATABASE ... TEMPLATE ...