public inbox for [email protected]
help / color / mirror / Atom feedFrom: vignesh C <[email protected]>
To: Shlok Kyal <[email protected]>
Cc: Álvaro Herrera <[email protected]>
Cc: Sergey Tatarintsev <[email protected]>
Cc: [email protected]
Subject: Re: Restrict publishing of partitioned table with a foreign table as partition
Date: Mon, 17 Feb 2025 20:12:49 +0530
Message-ID: <CALDaNm2+eL22Sbvj74uS37xvt=haQWcOwP15QnDuVeYsjHiffw@mail.gmail.com> (raw)
In-Reply-To: <CANhcyEWYJccdE0VP7dnMXGXvM3Lp5em_27hBu3tvi5N3=nWohg@mail.gmail.com>
References: <CALDaNm0EA4zuR+PiNmADGORcADQsPSmYKo=tr4hT=pSrLY1B9A@mail.gmail.com>
<[email protected]>
<CANhcyEXxjq9U7BXxCba3Njz+eHpNzAsSVY2GzbV=8iy5j=UAUA@mail.gmail.com>
<CALDaNm2Q1rNN-L8u95pjVRw-aBJkcGJh2bHeaPc2bO=mj_1QMA@mail.gmail.com>
<CANhcyEVbFMWnEkShq37SSgW7+X+xOxx9bvc4Jtj6BgAy9jGnqA@mail.gmail.com>
<CALDaNm3bULhtCaaBmdsun0LnHx9Jp0v228kjd=ZujEaaCEOmAA@mail.gmail.com>
<CANhcyEWYJccdE0VP7dnMXGXvM3Lp5em_27hBu3tvi5N3=nWohg@mail.gmail.com>
On Fri, 14 Feb 2025 at 12:59, Shlok Kyal <[email protected]> wrote:
>
> I have used the changes suggested by you. Also I have updated the
> comments and the function name.
There is another concurrency issue possible:
+/* Check if a partitioned table has a foreign partition */
+bool
+check_partrel_has_foreign_table(Form_pg_class relform)
+{
+ bool has_foreign_tbl = false;
+
+ if (relform->relkind == RELKIND_PARTITIONED_TABLE)
+ {
+ List *relids = NIL;
+
+ relids = find_all_inheritors(relform->oid, NoLock, NULL);
Create a publication with publish_via_partition_root as true, hold the
execution after check_partrel_has_foreign_table execution finishes.
Then parallely execute the following:
CREATE TABLE t1(id int) PARTITION BY RANGE(id);
CREATE TABLE part1 PARTITION OF t1 FOR VALUES FROM (0) TO (5);
CREATE TABLE part2 PARTITION OF t1 FOR VALUES FROM (5) TO (15)
PARTITION BY RANGE(id);
CREATE FOREIGN TABLE part2_1 PARTITION OF part2 FOR VALUES FROM (10)
TO (15) SERVER fdw
Now both the partitioned table having foreign table and a publication
will be created.
Regards,
Vignesh
view thread (9+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: Restrict publishing of partitioned table with a foreign table as partition
In-Reply-To: <CALDaNm2+eL22Sbvj74uS37xvt=haQWcOwP15QnDuVeYsjHiffw@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox