Re: Declarative partitioning - another take

From: alvherre(at)alvh(dot)no-ip(dot)org
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Declarative partitioning - another take
Date: 2016-11-03 11:46:51
Message-ID: 731eb99b111bab73383c2115cf26c29c@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

El 2016-10-28 07:53, Amit Langote escribió:

> @@ -6267,6 +6416,12 @@ ATAddForeignKeyConstraint(AlteredTableInfo *tab,
> Relation rel,
> * Validity checks (permission checks wait till we have the column
> * numbers)
> */
> + if (pkrel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
> + ereport(ERROR,
> + (errcode(ERRCODE_WRONG_OBJECT_TYPE),
> + errmsg("cannot reference relation \"%s\"",
> RelationGetRelationName(pkrel)),
> + errdetail("Referencing partitioned tables in foreign key
> constraints is not supported.")));

Is there a plan for fixing this particular limitation? It's a pretty
serious problem for users,
and the suggested workaround (to create a separate non-partitioned table
which carries only the PK
columns which is updated by triggers, and direct the FKs to it instead
of to the partitioned table)
is not only a very ugly one, but also very slow.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Abbas Butt 2016-11-03 12:18:53 Re: Using a latch between a background worker process and a thread
Previous Message Ashutosh Bapat 2016-11-03 11:26:41 Re: Danger of automatic connection reset in psql