Re: [HACKERS] New partitioning - some feedback

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: [HACKERS] New partitioning - some feedback
Дата
Msg-id CAEZATCVrup90-3P3fhTW22EO5iVdaNtFoDu7FHQf4UYEeOVaFA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] New partitioning - some feedback  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: [HACKERS] New partitioning - some feedback  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Re: [HACKERS] New partitioning - some feedback  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Список pgsql-hackers
On 12 July 2017 at 15:58, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
> Amit Langote wrote:
>> On 2017/07/11 13:34, Alvaro Herrera wrote:
>> > However, the "list tables"
>> > command \dt should definitely IMO not list partitions.
>>
>> Do you mean never?  Even if a modifier is specified?  In the patch I
>> proposed, \d! (or \d+ or \d++, if '!' turns out to be unpopular) will list
>> partitions, but \d or \dt won't.  That is, partitions are hidden by default.
>
> I don't think there is any need for a single list of all partition of
> all tables -- is there?  I can't think of anything, but then I haven't
> been exposed very much to this feature yet.  For now, I lean towards "never".
>

So just focusing on the listing issue for now...

I tend to agree with some of the upstream comments that a bare \d
should list everything, including partitions, because partitions are
still tables that you might want to do DML or DDL on.

Also, if you look at what we already have, \d lists all types of
relations, and then there are 2-letter commands \dE, \di, \dm, \ds,
\dt and \dv that list just specific kinds of relations, for example
\dE lists foreign tables, and \dt lists local tables, specifically
excluding foreign tables.

So ISTM that the most logical extension of that is:
 \d - list all relations, including partitions
 \dt - list only tables that are not foreign tables or partitions       of other tables

(that's not quite an exact extension of the existing logic, because of
course it's partitioned tables that have the different relkind, not
the partitions, but the above seems like the most useful behaviour)

With this, I don't think there's any need for any additional
modifiers, like ! or ++.

I also agree that there probably isn't much need for a list that
*only* includes partitions, but if someone comes up with a convincing
use case, then we could add another 2-letter command for that.


> I don't think \d! works terribly well as a mental model, but maybe
> that's just me.
>

Yeah, I agree. It just looks ugly somehow.


>> So it seems most of us are in favor for showing partitioned tables as
>> "partitioned table" instead of "table" in the table listing.
>
> Yeah, that sounds good to me.
>

+1

Regards,
Dean



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: [HACKERS] Causal reads take II
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [HACKERS] More race conditions in logical replication