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 problem is that I have 2

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 Bill Moran
wrote: - To: Medhavi Mahansaria medhavi.mahansa...@tcs.com From: Bill Moran wmo...@potentialtech.com Date: 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

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

2015-02-18 Thread Medhavi Mahansaria
...@tcs.com, pgsql-general@postgresql.org pgsql-general@postgresql.org From: Kevin Grittner kgri...@ymail.com Date: 02/18/2015 09:40PM Subject: Re: [GENERAL] #Personal#: Reg: Multiple queries in a transaction Medhavi Mahansaria medhavi.mahansa...@tcs.com wrote: I need to execute a series of queries

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

2015-02-18 Thread Medhavi Mahansaria
medhavi.mahansa...@tcs.com From: Bill Moran wmo...@potentialtech.com Date: 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 medhavi.mahansa...@tcs.com wrote: I need to execute

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: When Q2

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 a

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 medhavi.mahansa...@tcs.com 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

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

2015-02-18 Thread Kevin Grittner
Medhavi Mahansaria medhavi.mahansa...@tcs.com 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 errorERROR: current transaction is aborted, commands

[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