Re: [HACKERS] weird state after aborted transaction in pgsql 6.4

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: jwieck(at)debis(dot)com
Cc: davids(at)iol(dot)cz, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] weird state after aborted transaction in pgsql 6.4
Date: 1998-12-13 04:07:17
Message-ID: 199812130407.XAA13574@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> >
> > My database is in weird state after some operation. Here is an example:
> >
> > [david(at)kerberos david]$ psql
> > .....
> > david=> begin;
> > BEGIN
> > david=> create table tbl ( i int );
> > CREATE
> > david=> insert into tbl values(1);
> > INSERT 104137 1
> > EOFid=> [<ctrl-d> here]
> > [david(at)kerberos david]$ psql
> > ....
> > david=> create table tbl ( a text );
> > ERROR: cannot create tbl
> > david=> \d
> > Couldn't find any tables, sequences or indices!
> > ====================== cut here ======================
> > Simple question: why 'ERROR: cannot create tbl' ?
> > Platform: linux i586, glibc, regression tests seems ok (except minor
> > problem with floating point. The some problem have my colleague.
>
> The problem is, that the CREATE TABLE is inside the
> transaction. So the catalog updates for the new table get
> rolled back, but the file is still there. On the next CREATE
> TABLE the file creation (made with O_EXCL) fails.
>
> You can safely remove the file .../data/base/david/tbl and
> you should execute CREATE/DROP statements outside of
> transactions.
>

Added to TODO:

* CREATE TABLE inside aborted transaction causes stray table file

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-12-13 04:09:43 Re: [HACKERS] Bug report: PL/pgSQL and mixed case table/field names.
Previous Message Bruce Momjian 1998-12-13 03:58:30 Re: [HACKERS] COMMIT