Re: [GENERAL] #Personal#: Reg: Multiple queries in a transaction

2015-02-19 Thread Bill Moran
y. IT Services > Business Solutions > Consulting > > > > -Bill Moran wrote: - > To: Medhavi Mahansaria > From: Bill Moran > Date: 02/18/2015 09:23PM > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL]

Re: [GENERAL] #Personal#: Reg: Multiple queries in a transaction

2015-02-19 Thread Andrew Sullivan
On Thu, Feb 19, 2015 at 11:11:59AM +0530, Medhavi Mahansaria wrote: > > But savepoint concept will not work for me as desired. I don't see why not. > > Case 1: When Q2 fails (we delete the error), i want to continue to Q3 and > commit changes done by Q1 and Q3 once Q3 has executed successfully

Re: [GENERAL] #Personal#: Reg: Multiple queries in a transaction

2015-02-19 Thread David G Johnston
David G Johnston wrote > > Medhavi Mahansaria wrote >> Hi Bill, >> >> Thanks! >> >> But savepoint concept will not work for me as desired. >> >> Is there any other way apart from SAVEPOINT that can be incorporated. >> >> I am not using a script. I am writing a c++ program. >> >> My probl

Re: [GENERAL] #Personal#: Reg: Multiple queries in a transaction

2015-02-18 Thread David G Johnston
Medhavi Mahansaria wrote > Hi Bill, > > Thanks! > > But savepoint concept will not work for me as desired. > > Is there any other way apart from SAVEPOINT that can be incorporated. > > I am not using a script. I am writing a c++ program. > > My problem is that I have 2 cases: > > Case 1

Re: [GENERAL] #Personal#: Reg: Multiple queries in a transaction

2015-02-18 Thread Medhavi Mahansaria
e: 02/18/2015 09:23PM Cc: pgsql-general@postgresql.org Subject: Re: [GENERAL] #Personal#: Reg: Multiple queries in a transaction On Wed, 18 Feb 2015 20:36:45 +0530 Medhavi Mahansaria wrote: > I need to execute a series of queries in a transaction, say Q1, Q2, Q3. > > Q1 -> success

Re: [GENERAL] #Personal#: Reg: Multiple queries in a transaction

2015-02-18 Thread Medhavi Mahansaria
ostgresql.org" From: Kevin Grittner Date: 02/18/2015 09:40PM Subject: Re: [GENERAL] #Personal#: Reg: Multiple queries in a transaction Medhavi Mahansaria wrote: > I need to execute a series of queries > in a transaction, say Q1, Q2, Q3. > > Q1 -> success > Q2 -> Fail

Re: [GENERAL] #Personal#: Reg: Multiple queries in a transaction

2015-02-18 Thread David G Johnston
Medhavi Mahansaria wrote > I need to execute a series of queries in a transaction, say Q1, Q2, Q3. > [...] > Is there a way to turn autocommit off? I assume you meant turn Autocommit on? So, do you want to execute the queries in a transaction or do you want to autocommit each one? Autocommit is

Re: [GENERAL] #Personal#: Reg: Multiple queries in a transaction

2015-02-18 Thread Kevin Grittner
Medhavi Mahansaria wrote: > I need to execute a series of queries > in a transaction, say Q1, Q2, Q3. > > Q1 -> success > Q2 -> Failed > Q3 -> Success > > My issue is that after Q2 fails all > the queries that follow give error"ERROR: current transaction > is aborted, commands ignored until end

Re: [GENERAL] #Personal#: Reg: Multiple queries in a transaction

2015-02-18 Thread Bill Moran
On Wed, 18 Feb 2015 20:36:45 +0530 Medhavi Mahansaria wrote: > I need to execute a series of queries in a transaction, say Q1, Q2, Q3. > > Q1 -> success > Q2 -> Failed > Q3 -> Success > > My issue is that after Q2 fails all the queries that follow give error "E > RROR: current transaction is a

[GENERAL] #Personal#: Reg: Multiple queries in a transaction

2015-02-18 Thread Medhavi Mahansaria
Hi, I need to execute a series of queries in a transaction, say Q1, Q2, Q3. Q1 -> success Q2 -> Failed Q3 -> Success My issue is that after Q2 fails all the queries that follow give error "E RROR: current transaction is aborted, commands ignored until end of transaction block" I want to move