public inbox for [email protected]  
help / color / mirror / Atom feed
From: Rob Sargent <[email protected]>
To: Jacob Biesinger <[email protected]>
Cc: Greg Sabino Mullane <[email protected]>
Cc: [email protected]
Subject: Re: Ghost data from failed FDW transactions?
Date: Wed, 28 Aug 2024 16:16:08 -0600
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAHYXj6etiV1pTBvBiQFZ=jqxvNHczZio9cSSb7gMy+RrWwZTTQ@mail.gmail.com>
References: <CAHYXj6eJiX0jQpq4u7xYc1qy3=zBN+sPhGMTJETAF0fdoSyNUA@mail.gmail.com>
	<CAKAnmmJfKZejX0yE8dMHRZiQApq-PO_+aetGCHkkjK3VdOjD3w@mail.gmail.com>
	<CAHYXj6etiV1pTBvBiQFZ=jqxvNHczZio9cSSb7gMy+RrWwZTTQ@mail.gmail.com>



> On Aug 28, 2024, at 10:18 AM, Jacob Biesinger <[email protected]> wrote:
> 
> But to go deeper, we use the javascript knex adapter and some application-level transaction management that automatically retries a transaction N times when it encounters serialization errors. On this particular endpoint, the emitted SQL for the full transaction looks something like:
> 
> BEGIN;
> INSERT INTO "devices" ("orgId", "patientId", "deviceId", "data")
> VALUES (
> 'org1',
> 'patient1',
> 'device1',
> '{"id": "device1", "patientId": "patient1", "serialNumber": "12345", "status": "active" }'
> );
> INSERT INTO "devices" ("orgId", "patientId", "deviceId", "data")
> VALUES (
> 'org1',
> 'patient1',
> 'device2',
> '{"id": "device2", "patientId": "patient1", "serialNumber": "67890", "status": "active" }'
> );
> SELECT * FROM "rootDb"."assets";
> 
> -- execute some logic client-side, nothing touching the DB
> 
> UPDATE "rootDb"."assets" WHERE ...;
> COMMIT;
> 
Any value in supplying a single insert statement a la (less back and forth perhaps?):
BEGIN;
INSERT INTO "devices" ("orgId", "patientId", "deviceId", "data")
VALUES (
'org1',
'patient1',
'device1',
'{"id": "device1", "patientId": "patient1", "serialNumber": "12345", "status": "active" }’),
(
'org1',
'patient1',
'device2',
'{"id": "device2", "patientId": "patient1", "serialNumber": "67890", "status": "active" }'
)



view thread (6+ 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]
  Subject: Re: Ghost data from failed FDW transactions?
  In-Reply-To: <[email protected]>

* 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