[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    =?UTF-8?B?UmU6IGR5bmFtaWMgcGFydGl0aW9uIHRhYmxlIGluc2VydHM=?=
From:       Николай Кобзарев <n.kobzarev () aeronavigat
Date:       2023-01-25 16:49:13
Message-ID: 1674665353.958767179 () f409 ! i ! mail ! ru
[Download RAW message or body]

[Attachment #2 (text/plain)]

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


[Attachment #3 (text/html)]


<HTML><BODY>Hi!<div><br></div><div>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.</div><div>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.</div><div><br><br><blockquote \
style="border-left:1px solid #0857A6; margin:10px; padding:0 0 0 10px;">  Среда, \
25 января 2023, 16:38 +03:00 от Ted Toth &lt;txtoth@gmail.com&gt;:<br>  <br>
	<div id=""><div class="js-helper js-readmsg-msg">
    
    <style type="text/css"></style>
    <base target="_self" href="https://touch.mail.ru/">
    <div id="style_16746539010787115861">
        <div id="style_16746539010787115861_BODY"><div class="cl_668215"><div \
dir="ltr">I'm creating partition tables on the fly following the technique described \
in&nbsp;<a href="https://minervadb.com/index.php/postgresql-dynamic-partitioning/" \
target="_blank" rel=" noopener \
noreferrer">https://minervadb.com/index.php/postgresql-dynamic-partitioning/</a> . \
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?<div><br></div><div>Ted</div></div> </div></div>
        
    </div>
</div></div>
</blockquote>
<br><br>С уважением,<br>Николай \
Кобзарев<br>n.kobzarev@aeronavigator.ru<br></div></BODY></HTML>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic