Re: wrong message when trying to create an already existing index

2018-03-10 Thread legrand legrand
> regression=# create index mv1 on t1 (f1); ... > ERROR: materialized view "mv1" already exists Is in fact the one I prefer ;^) I come from a DBMS world where Tables and Indexes do not share the same name space, and have to change my mind ! Thanks you Tom for pointing that. Regards PAscal

Re: wrong message when trying to create an already existing index

2018-03-10 Thread Tom Lane
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=#

Re: wrong message when trying to create an already existing index

2018-03-10 Thread legrand legrand
OK, that noted ! thank you for the quick answers Regards PAscal -- Sent from: http://www.postgresql-archive.org/PostgreSQL-general-f1843780.html

Re: wrong message when trying to create an already existing index

2018-03-10 Thread legrand legrand
I thougth that thoses messages where using relation's relkind: r = ordinary table, i = index, S = sequence, t = TOAST table, v = view, m = materialized view, c = composite type, f = foreign table, p = partitioned table wouldn't it be easier to read for beginners ?

Re: wrong message when trying to create an already existing index

2018-03-10 Thread Adrian Klaver
On 03/10/2018 07:00 AM, legrand legrand wrote: Hello, When trying to create an already existing index (in pg 9.5) SQL> create index if not exists NEWINDEX on SCHEMA.TABLE(COL); > relation "NEWINDEX" already exists, skipping message speaks about relation (and not index)