Big script execution

From: Igor Korot <ikorot01(at)gmail(dot)com>
To: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Big script execution
Date: 2025-03-10 16:21:49
Message-ID: CA+FnnTx2Q=C-hUEBU08GMmfa0AGPt=XETnOW6G+=MyjrVmb7+Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, ALL,
I am trying to execute a huge script (~40K lines) that will populate
my database.

The script starts with "BEGIN TRANSACTION" and will end
with "COMMIT".

however I'd like to rollback if there is an error encounter.

When I execute it from the Terminal I do use

-v ON_ERROR_STOP=1

but I'd like to rolback the transaction so it starts a fresh every time.

Is there some kind of

ON ERROR ROLLBACK

command I can put inside the script?

Thank you.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2025-03-10 16:31:51 Re: Big script execution
Previous Message Nathan Bossart 2025-03-10 15:15:19 Re: Clarification on Role Access Rights to Table Indexes