table rename oddity - Mailing list pgsql-general

From Ari Jolma
Subject table rename oddity
Date
Msg-id 200005251244.PAA18592@water.hut.fi
Whole thread Raw
Responses Re: table rename oddity  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hello,

Is this kind of behavior intended. When I try to rename a table to
a reserved word -  I have tried to use 'lseg' which is a type - postgres
gives me an error but the change has been partly done and the
only way back seems to be to go to the database directory and
rename the file. I have tested this with version 7.0.

Regards,

Ari Jolma

An example:

template1=> create table a (a int);
CREATE
template1=> alter table a rename to lseg;
ERROR:  TypeRename: type lseg already defined
template1=> \dt

Database    = template1
+------------------+----------------------------------+----------+
|  Owner           |             Relation             |   Type   |
+------------------+----------------------------------+----------+
| ajolma           | a                                | table    |
+------------------+----------------------------------+----------+
template1=> select * from a;
NOTICE:  mdopen: couldn't open a: No such file or directory
NOTICE:  RelationIdBuildRelation: smgropen(a): No such file or directory
NOTICE:  mdopen: couldn't open a: No such file or directory
NOTICE:  mdopen: couldn't open a: No such file or directory
NOTICE:  mdopen: couldn't open a: No such file or directory
NOTICE:  mdopen: couldn't open a: No such file or directory
ERROR:  cannot open relation a
template1=> drop table a;
NOTICE:  mdopen: couldn't open a: No such file or directory
NOTICE:  mdopen: couldn't open a: No such file or directory
DROP
template1=> \dt
Couldn't find any tables!




pgsql-general by date:

Previous
From: harshavardhan@itil.com
Date:
Subject: query...urgent
Next
From: Ari Jolma
Date:
Subject: problem with NOTICE: _outNode: don't know how to print type