A very simple question about rollback/commit

Поиск
Список
Период
Сортировка
От Della-Croce, Gregory
Тема A very simple question about rollback/commit
Дата
Msg-id F1CFB1E7A51CD846898BB039F441E04F0960B38FC0@elijah
обсуждение исходный текст
Ответы Re: A very simple question about rollback/commit  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-novice

I am new to working with PostgreSQL and need to create a pgSQL process that I can run against a 8.4 PostgreSQL database.   The code will need to look something like:

BEGIN;

SAVEPOINT sp1;

UPDATE location SET delete = 1 WHERE delete=0 RETRUNING count;

[code to rollback if there is an error or commit if everything was good]

 

It is that code for knowing that there was an error and doing the Rollback that I can’t remember how to do.  I looked through the PostgreSQL Documentation for an example but I couldn’t find it.   It has been a very long time since I wrote SQL code.

 

Oh, another small question, since this is not being embedded in an program like C#, VB, etc, the two tool I have are pgADMIN III and SSH.   Can this be done in pgADMIN III?

 

Thanks to those that will help me with a simple solution.

 

Greg Della-Croce

Applications Administrator

 

Greg_Della-Croce@Wycliffe.org

SKYPE: GDellaCroce55

Cell: 407-408-2572

                                                                   THINK ON THIS:

"All that is valuable in human society depends upon the opportunity for development accorded the individual" ~ Albert Einstein

“All this is valuable in Christ’s Kingdom depens upon the opportunity for development accorded the individual by the Holy Spirit to Glorify the Father”  ~ Greg Della-Croce

 

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

Предыдущее
От: Ioannis Anagnostopoulos
Дата:
Сообщение: Re: Aggregate from CASE WHEN...
Следующее
От: JORGE MALDONADO
Дата:
Сообщение: How to apply a regular expression to a select statement