public inbox for [email protected]
help / color / mirror / Atom feedFrom: David G. Johnston <[email protected]>
To: Igor Korot <[email protected]>
Cc: pgsql-generallists.postgresql.org <[email protected]>
Subject: Re: Insert records in the tavke only if they are not exist
Date: Fri, 6 Dec 2024 20:55:00 -0700
Message-ID: <CAKFQuwZmv_R-v5050iF9YynOPqzEzi8atj_w1Sjo6CaNBgZLPg@mail.gmail.com> (raw)
In-Reply-To: <CA+FnnTwcNNGsM_ck0ye1OsUN3Jjg94PzGMKRm--2ojJM_zVOMA@mail.gmail.com>
References: <CA+FnnTwcNNGsM_ck0ye1OsUN3Jjg94PzGMKRm--2ojJM_zVOMA@mail.gmail.com>
On Friday, December 6, 2024, Igor Korot <[email protected]> wrote:
>
> When my application starts up, ot creates some tables and insert records
> in them.
>
> When the app starts for the second time it should check if the tables and
> the records in them are exist and skip the process.
>
> Everything is good, except what if I have a connection from 2 different
> users?
>
> I can run this inside transaction, but will this be enough? Will stating
> transaction lock the DB and the second user will wait for transaction to
> complete?
>
>
Seems like letting the create table fail would be a reliable way to
determine what is happening. But this procedure overall just seems better
avoided. Can’t you just run an installer/updater separate from running the
application?
David J.
view thread (2+ 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]
Subject: Re: Insert records in the tavke only if they are not exist
In-Reply-To: <CAKFQuwZmv_R-v5050iF9YynOPqzEzi8atj_w1Sjo6CaNBgZLPg@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