Re: dynamic partition table inserts - Mailing list pgsql-general

From Николай Кобзарев
Subject Re: dynamic partition table inserts
Date
Msg-id 1674665353.958767179@f409.i.mail.ru
Whole thread Raw
In response to dynamic partition table inserts  (Ted Toth <txtoth@gmail.com>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Ted Toth
Date:
Subject: dynamic partition table inserts
Next
From: "Dirschel, Steve"
Date:
Subject: DBeaver session populating pg_stat_activity.backend_xmin