Big script execution - Mailing list pgsql-general

From Igor Korot
Subject Big script execution
Date
Msg-id CA+FnnTx2Q=C-hUEBU08GMmfa0AGPt=XETnOW6G+=MyjrVmb7+Q@mail.gmail.com
Whole thread Raw
Responses Re: Big script execution
List 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.



pgsql-general by date:

Previous
From: H
Date:
Subject: Re: Creating files with testdata
Next
From: "Rhys A.D. Stewart"
Date:
Subject: Re: exclusion constraint question