pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alex Turner <aturner@maaco.com>
Cc: pgsql-interfaces@postgreSQL.org <pgsql-interfaces@postgreSQL.org>
Subject: Re: [INTERFACES] Wierd error when creating a table...
Date: Thu, 27 May 1999 16:54:52 -0400
Message-ID: <23539.927838492@sss.pgh.pa.us> (raw)
In-Reply-To: <374D8592.12DFE589@maaco.com>

Alex Turner <aturner@maaco.com> writes:
> When I try to create a table where the primary key is set to be a column
> that is of type int8 or int28 it complains giving me the following
> error:

> ERROR:  Can't find a default operator class for type 22.

Postgres 6.4 doesn't have support for indexes on int8 fields (but 6.5
does).  There is no support for indexes on int28 in either release.

> If I try to define the table again, it tells me that the relation
> already exists, yet it doesnt who up on the table list when I hit \d in
> psql.

That's a bug: the physical file for the relation has already been
created by the time the failure in creating the index occurs, and
although all the updates to system tables get backed out, the empty
file is not removed during the transaction abort.  So the table is
not there as far as any subsequent SQL commands are concerned, but
CREATE TABLE is (very properly IMHO) unwilling to overwrite any
random file it finds in the database directory.

You can reach into the data/base/YOURDB/ directory and delete the file
by hand.

I believe fixing this is on the TODO list, but I see that the bug is
still there in 6.5-current.  Something we might be able to squeeze in
for 6.5 is a more helpful error message ("I don't want to overwrite
file thus-and-so, delete it by hand if you are sure it's OK...").

			regards, tom lane



view thread (3+ messages)  latest in thread

Message-ID: <23539.927838492@sss.pgh.pa.us>
Permalink:  ../23539.927838492@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/23539.927838492@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: tgl@sss.pgh.pa.us, aturner@maaco.com
  Subject: Re: [INTERFACES] Wierd error when creating a table...
  In-Reply-To: <23539.927838492@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox