From: | "Mark Pritchard" <mark(at)tangent(dot)net(dot)au> |
---|---|
To: | "James Thornton" <james(at)unifiedmind(dot)com> |
Cc: | <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: DDLs in Transactions...? |
Date: | 2002-01-03 20:45:26 |
Message-ID: | EGECIAPHKLJFDEJBGGOBGEKBFOAA.mark@tangent.net.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Looks like it supports transactions:
[postgres(at)drow postgres]$ /usr/local/pgsql/bin/psql template1
Welcome to psql, the PostgreSQL interactive terminal.
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help on internal slash commands
\g or terminate with semicolon to execute query
\q to quit
template1=# begin;
BEGIN
template1=# create table intransaction (field1 int);
CREATE
template1=# rollback;
ROLLBACK
template1=# select * from intransaction;
ERROR: Relation 'intransaction' does not exist
template1=# begin;
BEGIN
template1=# create table intransaction (field1 int);
CREATE
template1=# commit;
COMMIT
template1=# select * from intransaction ;
field1
--------
(0 rows)
template1=# begin;
BEGIN
template1=# drop table intransaction;
DROP
template1=# rollback;
ROLLBACK
template1=# select * from intransaction ;
field1
--------
(0 rows)
template1=# begin;
BEGIN
template1=# drop table intransaction;
DROP
template1=# commit;
COMMIT
template1=# select * from intransaction;
ERROR: Relation 'intransaction' does not exist
template1=#
Cheers,
Mark Pritchard
> -----Original Message-----
> From: pgsql-hackers-owner(at)postgresql(dot)org
> [mailto:pgsql-hackers-owner(at)postgresql(dot)org]On Behalf Of James Thornton
> Sent: Sunday, 30 December 2001 8:12 AM
> To: pgsql-hackers(at)postgresql(dot)org
> Subject: [HACKERS] DDLs in Transactions...?
>
>
> How does PG handle DDL statements that are wrapped in a transaction?
> Does it roll them back if one fails, or is it like Oracle?
>
> Where is this documented?
>
> Thanks.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2002-01-03 20:58:02 | Re: More problem with scripts |
Previous Message | Bruce Momjian | 2002-01-03 20:42:05 | Re: Bulkloading using COPY - ignore duplicates? |