Lothar Scholz
wrote:
Transactions do not rewind drop table statements and other schema
manipulations.
That's not true. Schema changes, including DROP TABLE statemens, done
within a transaction can be happily rolled back. Just try it and see.
Igor Tandetnik
Hello Igor,
Tuesday, January 29, 2008, 9:06:56 AM, you wrote:
IT> Lothar Scholz
IT> wrote:
>> This is copying the whole table twice. Is there any reason why it
>> shouldn't be:
>>
>> BEGIN TRANSACTION;
>> CREATE TEMPORARY TABLE t1_backup(a,b);
>> INSERT INTO t1_backup SELECT a,b FROM t1;
>>
Lothar Scholz
wrote:
This is copying the whole table twice. Is there any reason why it
shouldn't be:
BEGIN TRANSACTION;
CREATE TEMPORARY TABLE t1_backup(a,b);
INSERT INTO t1_backup SELECT a,b FROM t1;
DROP TABLE t1;
ALTER TABLE t1_backup RENAME TO t1;
COMMIT;
t1_backup is a temporary table.
3 matches
Mail list logo