Re: Inheriting table AMs for partitioned tables

Поиск
Список
Период
Сортировка
Искать
От
David Rowley
Тема
Re: Inheriting table AMs for partitioned tables
Дата
Msg-id
CAKJS1f8v6PByAukvnaJbe3HpSSzjhyDzRByoGdDAZSyqfj6+KA@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Inheriting table AMs for partitioned tables Andres Freund <andres@anarazel.de>
Re: Inheriting table AMs for partitioned tables Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Inheriting table AMs for partitioned tables Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: Inheriting table AMs for partitioned tables Amit Kapila <amit.kapila16@gmail.com>
Re: Inheriting table AMs for partitioned tables Haribabu Kommi <kommi.haribabu@gmail.com>
Re: Inheriting table AMs for partitioned tables David Rowley <david.rowley@2ndquadrant.com>
Re: Inheriting table AMs for partitioned tables Andres Freund <andres@anarazel.de>
Re: Inheriting table AMs for partitioned tables Andres Freund <andres@anarazel.de>
Re: Inheriting table AMs for partitioned tables Robert Haas <robertmhaas@gmail.com>
Re: Inheriting table AMs for partitioned tables David Rowley <david.rowley@2ndquadrant.com>
Re: Inheriting table AMs for partitioned tables David Rowley <david.rowley@2ndquadrant.com>
Re: Inheriting table AMs for partitioned tables David Rowley <david.rowley@2ndquadrant.com>
On Tue, 5 Mar 2019 at 19:08, Andres Freund  wrote:
>
> On 2019-03-05 16:01:50 +1300, David Rowley wrote:
> > I'd suggest it's made to work the same way as ca4103025dfe26 made
> > tablespaces work.
>
> Hm, is that actually correct?  Because as far as I can tell that doesn't
> have the necessary pg_dump code to make this behaviour persistent:
>
> CREATE TABLESPACE frak LOCATION '/tmp/frak';
> CREATE TABLE test_tablespace (a text, b int) PARTITION BY list (a) TABLESPACE frak ;
> CREATE TABLE test_tablespace_1 PARTITION OF test_tablespace FOR VALUES in ('a');
> CREATE TABLE test_tablespace_2 PARTITION OF test_tablespace FOR VALUES in ('b') TABLESPACE pg_default;
> CREATE TABLE test_tablespace_3 PARTITION OF test_tablespace FOR VALUES in ('c') TABLESPACE frak;
>
> SELECT relname, relkind, reltablespace FROM pg_class WHERE relname LIKE 'test_tablespace%' ORDER BY 1;
> ┌───────────────────┬─────────┬───────────────┐
> │      relname      │ relkind │ reltablespace │
> ├───────────────────┼─────────┼───────────────┤
> │ test_tablespace   │ p       │         16384 │
> │ test_tablespace_1 │ r       │         16384 │
> │ test_tablespace_2 │ r       │             0 │
> │ test_tablespace_3 │ r       │         16384 │
> └───────────────────┴─────────┴───────────────┘

[pg_dump/pg_restore]

> ┌───────────────────┬─────────┬───────────────┐
> │      relname      │ relkind │ reltablespace │
> ├───────────────────┼─────────┼───────────────┤
> │ test_tablespace   │ p       │         16384 │
> │ test_tablespace_1 │ r       │         16384 │
> │ test_tablespace_2 │ r       │         16384 │
> │ test_tablespace_3 │ r       │         16384 │
> └───────────────────┴─────────┴───────────────┘

frak... that's a bit busted. I can't instantly think of a fix, but I
see the same problem does not seem to exist for partition indexes, so
that's a relief since that's already in PG11.

I'll take this up on another thread once I have something good to report.

-- 
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
В списке pgsql-hackers по дате отправления
От: David Rowley
Дата:
От: Amit Langote
Дата:
FAQ