From: Tom Lane <tgl@sss.pgh.pa.us>
To: legrand legrand <legrand_legrand@hotmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: wrong message when trying to create an already existing index
Date: Sat, 10 Mar 2018 12:10:05 -0500
Message-ID: <23126.1520701805@sss.pgh.pa.us> (raw)
In-Reply-To: <1520697247176-0.post@n3.nabble.com>
References: <1520694050596-0.post@n3.nabble.com>
<eb1270d7-851f-ed6a-51be-e4f336f09853@aklaver.com>
<1520697247176-0.post@n3.nabble.com>
legrand legrand <legrand_legrand@hotmail.com> writes:
> I thougth that thoses messages where using relation's relkind:
> ..
> wouldn't it be easier to read for beginners ?
I doubt it would be an improvement. Consider this example:
regression=# create table t1 (f1 int);
CREATE TABLE
regression=# create materialized view mv1 as select * from t1;
SELECT 0
regression=# create index mv1 on t1 (f1);
ERROR: relation "mv1" already exists
You seem to be proposing that the error should read either
ERROR: index "mv1" already exists
which would be a lie, or
ERROR: materialized view "mv1" already exists
which while accurate seems to me to be *more* confusing not less.
A person who did not understand that these relation types all
share the same namespace would probably not get enlightened
this way. Using the generic term "relation" is just as accurate,
and it might help somebody understand that the problem is exactly
that relations of different types share the same namespace.
regards, tom lane
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tgl@sss.pgh.pa.us, legrand_legrand@hotmail.com
Subject: Re: wrong message when trying to create an already existing index
In-Reply-To: <23126.1520701805@sss.pgh.pa.us>
References: <1520694050596-0.post@n3.nabble.com> <eb1270d7-851f-ed6a-51be-e4f336f09853@aklaver.com> <1520697247176-0.post@n3.nabble.com> <23126.1520701805@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