Re: partitioned tables referenced by FKs

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: partitioned tables referenced by FKs
Дата
Msg-id 20181130191216.5xcxcsx3ascgqayv@alvherre.pgsql
обсуждение исходный текст
Ответ на partitioned tables referenced by FKs  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: partitioned tables referenced by FKs  (Jesper Pedersen <jesper.pedersen@redhat.com>)
Re: partitioned tables referenced by FKs  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Список pgsql-hackers
Here's a more credible version of this patch series.

0001 refactors some duplicative code that interprets a pg_constraint row
for a foreign key back into a Constraint node.  Only what is necessary
for current features is read.

0002 moves some code that I added in 3de241dba86f to
src/backend/catalog/pg_constraint.c so that it appears in tablecmds.c
instead.  After developing the current patch I realized that the latter
is its natural home.

0003 changes the shape of a loop in deleteObjectsInList, so that I can
add object type-specific functions to be called before deleting an
object.  This is needed by 0004 and makes no sense on its own; I would
probably push both together, but splitting it like this makes it very
obvious what it is I'm doing.

0004 adds the feature itself

In 0004 there's also a new function "index_get_partition" which allows
to simplify some code I added in 8b08f7d4820f.  I will probably split it
up and commit separately because it's an obvious code beautify.

0005 modifies psql to show the constraint in a different way, which
makes more sense overall (rather than show the "internal" constraint
that concerns the partition, show the top-level contraint that concerns
the ancestor table on which it is defined.  This includes naming the
table in which the constraint is defined).

There's one half of 0005 that I think should be applied to pg11, because
when partitions have foreign keys, the display looks a bit odd
currently.  The other half I would probably merge into 0004 instead of
committing separately.  Even if not backpatched, it makes sense to apply
ahead of the rest because it changes expected output for a regression
test.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Вложения

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: ToDo: show size of partitioned table
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: pgsql: Switch pg_verify_checksums back to a blacklist