Re: Error creating tables. - Mailing list pgsql-general

From Tom Lane
Subject Re: Error creating tables.
Date
Msg-id 27180.971380432@sss.pgh.pa.us
Whole thread Raw
In response to Error creating tables.  (Aristide Aragon <aristide@lionking.org>)
List pgsql-general
Aristide Aragon <aristide@lionking.org> writes:
> create table test4 (name varchar(10)) ;
> returns
> ERROR:  cannot create test4

That looks like the physical creation of the table data file for 'test4'
is failing.  Unfortunately older releases of postgres are not very
good about reporting the kernel error code that would tell us why it
failed.  (This is fixed in current sources, and I think in 7.0.2 as well.)

I will venture that there is a file named 'test4' hanging around in your
database directory, possibly from an earlier version of the table that
was incompletely created or deleted.  (Evidently there's no pg_class
entry for test4, or you'd have gotten a different error message.  But
the physical file is there.)  Since you mention backend crashes,
an incomplete table creation seems the most likely bet for the cause.

If Postgres doesn't believe it has a table named test4 (use psql's \d
to check) then it's safe to just delete the unwanted file with rm.

> My version of postgresql is 6.5.1

I'd strongly recommend an update to 7.0.2.  We've fixed an awful lot
of bugs since 6.5.

            regards, tom lane

pgsql-general by date:

Previous
From: Louis Bertrand
Date:
Subject: Re: Re: PostgreSQL book
Next
From: Bruce Momjian
Date:
Subject: Re: Re: PostgreSQL book