FAQ
Hi list,

I am dumping a series of data. Basically I'm migrating the tables from one
database to another. However, I wanted the transaction to stop immediately
as soon as the error below occurs:

psql:gravy.all.schema.sql:142136: ERROR: current transaction is aborted,
commands ignored until end of transaction block

What happens is that it continues to do the transaction even if there's
already a transaction and I'm having hard time catching it. I need to know
which line number the error first occured so that I can check my dump file
and do the necessary remedy.


Thanks,

Ridvan


--
Laurence J. Peter - "Originality is the fine art of remembering what you
hear but forgetting where you heard it."

Search Discussions

  • John DeSoi at Jul 17, 2008 at 11:35 am

    On Jul 17, 2008, at 12:49 AM, Ridvan Lakas ng Bayan S. Baluyos wrote:

    I am dumping a series of data. Basically I'm migrating the tables
    from one database to another. However, I wanted the transaction to
    stop immediately as soon as the error below occurs:

    psql:gravy.all.schema.sql:142136: ERROR: current transaction is
    aborted, commands ignored until end of transaction block

    What happens is that it continues to do the transaction even if
    there's already a transaction and I'm having hard time catching it.
    I need to know which line number the error first occured so that I
    can check my dump file and do the necessary remedy.

    Put this at the stop of your file to make psql stop when an error
    occurs:

    \set ON_ERROR_STOP 1




    John DeSoi, Ph.D.
  • Ridvan Lakas ng Bayan S. Baluyos at Jul 21, 2008 at 1:37 am

    On Thu, Jul 17, 2008 at 7:36 PM, John DeSoi wrote:

    Put this at the stop of your file to make psql stop when an error occurs:

    \set ON_ERROR_STOP 1

    Thanks for this! This is basically what I need!


    Ridvan

    --
    Bill Cosby - "Advertising is the most fun you can have with your clothes
    on."

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppgsql-novice @
categoriespostgresql
postedJul 17, '08 at 5:16a
activeJul 21, '08 at 1:37a
posts3
users2
websitepostgresql.org
irc#postgresql

People

Translate

site design / logo © 2023 Grokbase