Re: creating index names automatically?

Ron Mayer <rm_pg@cheapcomplexdevices.com>

From: Ron Mayer <rm_pg@cheapcomplexdevices.com>
To: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-hackers@postgresql.org
Date: 2009-12-20T09:10:36Z
Lists: pgsql-hackers
Peter Eisentraut wrote:
> Could we create an option to create index names automatically, so you'd
> only have to write
> 
> CREATE INDEX ON foo (a);
> 
> which would pick a name like foo_a_idx.  

Why wouldn't it default to a name more like:

  CREATE INDEX "foo(a)" on foo(a);

which would extend pretty nicely to things like:

  CREATE INDEX "foo USING GIN(hstore)" ON foo USING GIN(hstore);'

Seems to be both more readable and less chance for arbitrary
collisions if I have column names with underscores.  Otherwise
what would the rule distinguishing "create index on foo(a_b)"
from "create index on foo(a,b)", etc.