Re: Truncate table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Burak Seydioglu" <buraks78(at)gmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Truncate table
Date: 2007-08-24 01:34:22
Message-ID: 15860.1187919262@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"Burak Seydioglu" <buraks78(at)gmail(dot)com> writes:
> I have been reading about transactional DDLs at
> http://archives.postgresql.org/pgsql-general/2007-06/msg00190.php.
> This discussion seems to be recent though; is this feature available
> in version 7.4?

It would've taken you less time to test it than to post the question.

regression=# select version();
version
----------------------------------------------------------------
PostgreSQL 7.4.17 on hppa-hp-hpux10.20, compiled by GCC 2.95.3
(1 row)

regression=# create table foo (f1 int);
CREATE TABLE
regression=# insert into foo values(1);
INSERT 1555575 1
regression=# begin;
BEGIN
regression=# truncate table foo;
TRUNCATE TABLE
regression=# abort;
ROLLBACK
regression=# select * from foo;
f1
----
1
(1 row)

Looks transactional to me ...

Just FYI, 7.3 fails the same test with

regression=# truncate table foo;
ERROR: TRUNCATE TABLE cannot run inside a transaction block

so it got fixed between 7.3 and 7.4.

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Oliveiros Cristina 2007-08-24 11:50:58 How to import a csv
Previous Message Burak Seydioglu 2007-08-23 22:08:07 Truncate table