Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eui0Z-0001fT-Qf for pgsql-general@arkaria.postgresql.org; Sat, 10 Mar 2018 17:10:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eui0Y-0002UH-LC for pgsql-general@arkaria.postgresql.org; Sat, 10 Mar 2018 17:10:10 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eui0Y-0002Ty-9Q for pgsql-general@lists.postgresql.org; Sat, 10 Mar 2018 17:10:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eui0V-00009Q-Sm for pgsql-general@postgresql.org; Sat, 10 Mar 2018 17:10:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w2AHA5dS023127; Sat, 10 Mar 2018 12:10:05 -0500 From: Tom Lane To: legrand legrand cc: pgsql-general@postgresql.org Subject: Re: wrong message when trying to create an already existing index In-reply-to: <1520697247176-0.post@n3.nabble.com> References: <1520694050596-0.post@n3.nabble.com> <1520697247176-0.post@n3.nabble.com> Comments: In-reply-to legrand legrand message dated "Sat, 10 Mar 2018 08:54:07 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <23125.1520701805.1@sss.pgh.pa.us> Date: Sat, 10 Mar 2018 12:10:05 -0500 Message-ID: <23126.1520701805@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk legrand legrand 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