Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Novice > Re: Stopping a ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 3 Topic 3173 of 3255
Post > Topic >>

Re: Stopping a transaction as soon as an error occurs

by desoi@[EMAIL PROTECTED] (John DeSoi) Jul 17, 2008 at 07:36 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.





-- 
Sent via pgsql-novice mailing list (pgsql-novice@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-novice
 




 3 Posts in Topic:
Stopping a transaction as soon as an error occurs
ridvan@[EMAIL PROTECTED]   2008-07-17 12:49:17 
Re: Stopping a transaction as soon as an error occurs
desoi@[EMAIL PROTECTED]   2008-07-17 07:36:23 
Re: Stopping a transaction as soon as an error occurs
ridvan@[EMAIL PROTECTED]   2008-07-21 09:30:34 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Oct 12 14:21:24 CDT 2008.