pg.ddx.io pgsql-general@postgresql.org mailing list archive
help / color / mirror / Atom feeddynamic partition table inserts
2+ messages / 2 participants
[nested] [flat]
* dynamic partition table inserts
@ 2023-01-25 13:38 Ted Toth <txtoth@gmail.com>
0 siblings, 1 reply; 2+ messages in thread
From: Ted Toth @ 2023-01-25 13:38 UTC (permalink / raw)
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
I'm creating partition tables on the fly following the technique described
in https://minervadb.com/index.php/postgresql-dynamic-partitioning/ .
Regardless of whether a partition table is created or already exists all I
really want to do is change the destination table (TG_TABLE_NAME?) of the
insert to the partition table. Is this possible or is my only option to
generate a new insert as in the example?
Ted
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: dynamic partition table inserts
@ 2023-01-25 16:49 Николай Кобзарев <n.kobzarev@aeronavigator.ru>
parent: Ted Toth <txtoth@gmail.com>
0 siblings, 0 replies; 2+ messages in thread
From: Николай Кобзарев @ 2023-01-25 16:49 UTC (permalink / raw)
To: txtoth@gmail.com; +Cc: pgsql-general@lists.postgresql.org
Hi!
Please be warned that this approach (if not exists create) is not thread safe, even "create table if not exists" syntax is not thread safe too.
Im using this kind of "dynamic partitioning" and use Advisory locks to make sure creating partitions is thread safe. Im using native partitioning, so no special dynamic inserts/selects is required. Consider maintanance procedure, when you create all required partitions in advance.
>Среда, 25 января 2023, 16:38 +03:00 от Ted Toth <txtoth@gmail.com>:
>
>I'm creating partition tables on the fly following the technique described in https://minervadb.com/index.php/postgresql-dynamic-partitioning/ . Regardless of whether a partition table is created or already exists all I really want to do is change the destination table (TG_TABLE_NAME?) of the insert to the partition table. Is this possible or is my only option to generate a new insert as in the example?
>
>Ted
С уважением,
Николай Кобзарев
n.kobzarev@aeronavigator.ru
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2023-01-25 16:49 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2023-01-25 13:38 dynamic partition table inserts Ted Toth <txtoth@gmail.com>
2023-01-25 16:49 ` Николай Кобзарев <n.kobzarev@aeronavigator.ru>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox