Re: Ghost data from failed FDW transactions?

From: Rob Sargent <robjsargent(at)gmail(dot)com>
To: Jacob Biesinger <jake(dot)biesinger(at)gmail(dot)com>
Cc: Greg Sabino Mullane <htamfids(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Ghost data from failed FDW transactions?
Date: 2024-08-28 22:16:08
Message-ID: 1568BE1C-261C-474A-803F-66B8B757F1B1@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Aug 28, 2024, at 10:18 AM, Jacob Biesinger <jake(dot)biesinger(at)gmail(dot)com> 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" }'
)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jacob Biesinger 2024-08-28 22:19:54 Re: Ghost data from failed FDW transactions?
Previous Message Tom Lane 2024-08-28 20:47:47 Re: Significant Execution Time Difference Between PG13.14 and PG16.4 for Query on information_schema Tables.