Re: reload-through-the-top-parent switch the partition table

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: reload-through-the-top-parent switch the partition table
Date: 2017-08-03 14:41:42
Message-ID: CA+TgmoagShWgtiJeWjpyGZOpNRB3W1WaED+2BFXiSJ672YP4uA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Aug 3, 2017 at 9:01 AM, Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com> wrote:
> --unpartition-partitioned-table is very confusing.

+1.

> I liked the previous option which is --use-partitioned-table
> [partition-name, ...].
> The Only problem with --use-partitioned-table is, a user needs to specify
> the
> partition-name in the options list. Imagine if someone having 100's of
> partitions then specifying those name is pg_dump option is a pain.

Yeah, that won't work.

> Rather than that:
>
> --use-partitioned-table [partitioned_name, ...] # if
> names are omitted it defaults to all the partitioned tables.
>
> Here user need to specify the root relation name in the option - and any
> partition table have that as a ROOT, will load the data through
> top-parent-relation.

We could do that, but I'm not sure it's a good idea to use
getopt_long() with optional options. Sometimes that creates confusion
-- is pg_dump --use-partitioned-table salad an attempt to dump the
salad database with the --use-partitioned-table option, or an attempt
to apply --use-partitioned-table only to partitions whose parent is
the salad table? getopt_long() has an answer, but some people may
guess incorrectly about what it is.

I would be more inclined to make this a global option than something
that modifies the behavior for certain tables; the only per-table
flags we have right now are just to include/exclude individual tables.
You could make --inserts or --no-unlogged-table-data apply to some but
not all tables, but we didn't; why start here?

I don't like the specific name --use-partitioned-table much either.
Use it for what?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-08-03 14:43:25 Re: reload-through-the-top-parent switch the partition table
Previous Message Tom Lane 2017-08-03 14:31:00 Re: pgbench: Skipping the creating primary keys after initialization