Re: canceling a delete

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: canceling a delete
Дата
Msg-id CAKFQuwaetkGycZgtdjDpJCXwpUf8+vQ2pD487X9Xa3pYxu5P4w@mail.gmail.com
обсуждение исходный текст
Ответ на canceling a delete  ("Campbell, Lance" <lance@illinois.edu>)
Список pgsql-admin
On Thu, May 19, 2016 at 2:44 PM, Campbell, Lance <lance@illinois.edu> wrote:

PostgreSQL 9.5.x

 

I logged onto PostgreSQL.  I did a command:

 

Delete from some_table;

 

I realized that I should have had a where clause.  So I canceled the delete with CTRL-C.  PostgreSQL said to canceled the delete.

 

Did PostgreSQL delete any records? 

 


​Mostly what Kevin said - though the first thing you should consider doing next time is "BEGIN;"

A single statement either succeeds or fails atomically - so either it deleted ALL records or none.

Once within a transaction you get to change your mind up until you issue a "COMMIT;"

David J.

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

Предыдущее
От: "Campbell, Lance"
Дата:
Сообщение: Re: canceling a delete
Следующее
От: Dave Johansen
Дата:
Сообщение: NO INHERIT and prepared statements?