Re: CREATE IF NOT EXISTS INDEX

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, fabriziomello(at)gmail(dot)com, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CREATE IF NOT EXISTS INDEX
Date: 2014-09-30 23:16:52
Message-ID: 20140930231652.GY2084@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2014-09-30 16:03:01 -0700, Josh Berkus wrote:
> On 09/30/2014 03:53 PM, Andres Freund wrote:
> > On 2014-09-30 18:47:24 -0400, Tom Lane wrote:
> >> Josh Berkus <josh(at)agliodbs(dot)com> writes:
> >>> On 09/30/2014 02:43 PM, Tom Lane wrote:
> >>>> =?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= <fabriziomello(at)gmail(dot)com> writes:
> >>>>> What's your thoughts about we implement IF NOT EXISTS for CREATE INDEX?
> >>
> >>>> It's got the same semantic problems as every other variant of CINE.
> >>
> >>> I do think it should be name-based.
> >>
> >> Name-based, eh? Don't you recall that in modern practice, people
> >> generally don't specify names for indexes at all? They've usually
> >> got system-generated names, which doesn't seem like a very cool thing
> >> to have scripts depending on.
> >
> > Good point. I think it's fair enough to only allow CINE on named
> > indexes.
>
> On the other hand, the way we form system-generated names is predicable,
> so I think it would be perfectly OK to include them. Desirable, in fact.

It's not really that predicable. Think about expression indexes. They
also don't contain information about opclasses et all.

Seems like pit of hairy semantics.

> Not that I'm a fan of omitting the name ...

Me neither.

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2014-09-30 23:19:04 Re: Allow format 0000-0000-0000 in postgresql MAC parser
Previous Message Josh Berkus 2014-09-30 23:03:01 Re: CREATE IF NOT EXISTS INDEX