Re: Transactional DDL
| От | Michael Glaesemann |
|---|---|
| Тема | Re: Transactional DDL |
| Дата | |
| Msg-id | 80F4E980-C713-4E80-BFA4-C5D870E00FC6@seespotcode.net обсуждение исходный текст |
| Ответ на | Re: Transactional DDL ("Jasbinder Singh Bali" <jsbali@gmail.com>) |
| Ответы |
Re: Transactional DDL
|
| Список | pgsql-general |
On Jun 2, 2007, at 10:12 , Jasbinder Singh Bali wrote:
> But its said that transactions in any RDBMS follow ACID properties.
> So if i put a create table and an Insert statement in the same
> begin end block as one single transactioin, won't both create and
> insert follow acid property, being in one single trasaction, and
> either both get committed or none, talking about oracle lets say
test=# \d
List of relations
Schema | Name | Type | Owner
--------+------+-------+----------
public | a | table | postgres
public | b | table | postgres
(2 rows)
test=# begin;
BEGIN
test=# create table foo (a integer);
CREATE TABLE
test=# insert into foo (a) values (1);
INSERT 0 1
test=# commit;
COMMIT
test=# \d
List of relations
Schema | Name | Type | Owner
--------+------+-------+----------
public | a | table | postgres
public | b | table | postgres
public | foo | table | postgres
(3 rows)
test=# select * from foo;
a
---
1
(1 row)
test=# begin;
BEGIN
test=# create table bar (a integer);
CREATE TABLE
test=# insert into bar (a) values (1);
INSERT 0 1
test=# select * from bar;
a
---
1
(1 row)
test=# \d
List of relations
Schema | Name | Type | Owner
--------+------+-------+----------
public | a | table | postgres
public | b | table | postgres
public | bar | table | postgres
public | foo | table | postgres
(4 rows)
test=# select 1/0;
ERROR: division by zero
test=# commit;
ROLLBACK
test=# \d
List of relations
Schema | Name | Type | Owner
--------+------+-------+----------
public | a | table | postgres
public | b | table | postgres
public | foo | table | postgres
(3 rows)
Michael Glaesemann
grzm seespotcode net
В списке pgsql-general по дате отправления: