Re: #Personal#: Reg: Multiple queries in a transaction

Поиск
Список
Период
Сортировка
От David G Johnston
Тема Re: #Personal#: Reg: Multiple queries in a transaction
Дата
Msg-id 1424332564656-5838539.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: #Personal#: Reg: Multiple queries in a transaction  (Medhavi Mahansaria <medhavi.mahansaria@tcs.com>)
Ответы Re: #Personal#: Reg: Multiple queries in a transaction  (David G Johnston <david.g.johnston@gmail.com>)
Список pgsql-general
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 fails (we delete the error), i want to continue to Q3 and
> commit changes done by Q1 and Q3 once Q3 has executed successfully.
>
> Case 2: When Q2 fails, I want it to throw an error. and rollback the
> changes made by Q1 and not proceed to Q3 at all.
>
> Note: This is just a small example. I need a solution for an entire
> application which follows the same concept across multiple queries.
>
> How can I incorporate this?

Forgo transactions or use savepoints.  Those are your tools.  If you cannot
find a way to solve your problem with those tools you either need to choose,
or build, a different toolbox or explain your actual problem in greater
detail so that others can see if there are solutions you are overlooking.

Or redefine your problem.

David J.





--
View this message in context:
http://postgresql.nabble.com/Personal-Reg-Multiple-queries-in-a-transaction-tp5838427p5838539.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


В списке pgsql-general по дате отправления:

Предыдущее
От: Medhavi Mahansaria
Дата:
Сообщение: Re: #Personal#: Reg: Multiple queries in a transaction
Следующее
От: David G Johnston
Дата:
Сообщение: Re: #Personal#: Reg: Multiple queries in a transaction