-----BEGIN PGP SIGNED MESSAGE-----
> Long Description
> ERROR: relation named "pk_exchange_batch_idx" already exists
> Why relation when I create index?
An index is a type of relation: other types of relations include tables,
views, and sequences. A relation is simply something in the database that
can be represented as a table. Each relations must have a unique name, no
matter what type it is:
=> create table foobar(a int);
=> create index foobar on foobar(a);
ERROR: relation named "foobar" already exists
=> create view foobar as select * from foobar;
ERROR: Relation 'foobar' already exists
You can see from the last example why having the same name would be a
problem - does "SELECT * FROM foobar" refer to the table 'foobar'
or the view 'foobar'? If we did not have the unique name contraint,
we would have to tell the database which 'foobar' we meant.
The error message you received means that *something* else already
has that name, but not necessarily an index.
Greg Sabino Mullane greg(at)turnstep(dot)com
PGP Key: 0x14964AC8 200302130948
-----BEGIN PGP SIGNATURE-----
-----END PGP SIGNATURE-----
In response to
pgsql-bugs by date
|Next:||From: Florian Wunderlich||Date: 2003-02-13 16:27:21|
|Subject: Re: Bug #866 related problem (ATTN Tom Lane)|
|Previous:||From: Greger Burman||Date: 2003-02-13 14:09:01|
|Subject: postmaster missing|