Re: CREATE IF NOT EXISTS INDEX - Mailing list pgsql-hackers

From Fabrízio de Royes Mello
Subject Re: CREATE IF NOT EXISTS INDEX
Date
Msg-id CAFcNs+r1XKTjFFiVAyR71LNXfWLMNbJC2pdgHYaENz-p7p_ahg@mail.gmail.com
Whole thread Raw
In response to Re: CREATE IF NOT EXISTS INDEX  (Marti Raudsepp <marti@juffo.org>)
Responses Re: CREATE IF NOT EXISTS INDEX
List pgsql-hackers
On Fri, Oct 3, 2014 at 5:26 AM, Marti Raudsepp <marti@juffo.org> wrote:
>
> "On Fri, Oct 3, 2014 at 6:25 AM, Fabrízio de Royes Mello
> <fabriziomello@gmail.com> wrote:
> >> Documentation: I would prefer if the explanation were consistent with
>
> > "Do not throw an error if the index already exists. A notice is issued in
> > this case."
> > Fixed in that way. Ok?
>
> And also "Note that there is no guarantee that the existing index is
> anything like the one that would have been created."
>

Fixed.


> >> I think ERRCODE_SYNTAX_ERROR makes more sense, it's something that we
> >> decided we *don't want* to support.
> > I don't think so. It's the same as CREATE SCHEMA IF NOT EXISTS that not
> > support to include schema elements.
>
> IMO that's wrong too, the CREATE SCHEMA documentation doesn't list it
> as valid syntax.
>
> But now that you split the syntax in two, you can simply replace
> "opt_index_name" with "index_name" and it will naturally cause a
> syntax error without the need for an if(). What do you think?
> Patch attached, which applies on top of your v4 patch.
>

Fine. Thanks.


> On Fri, Oct 3, 2014 at 6:29 AM, Fabrízio de Royes Mello
> <fabriziomello@gmail.com> wrote:
> >> I would also move this check to after all the attributes have been
> >> assigned, rather than splitting the assignments in half.
> > Why? If you see other places in gram.y it's a common usage...
>
> Looks cleaner to me: first input all the fields, then validate. And
> there are examples like this too, like "COPY select_with_parens". But
> this is moot now, if you agree with my grammar change.
>

I agree with your grammar change.


> On Fri, Oct 3, 2014 at 6:35 AM, Fabrízio de Royes Mello
> <fabriziomello@gmail.com> wrote:
> > And just to remember please add your review to commitfest
>
> Thanks for reminding, I always forget to update the CommitFest... :(
>

You're welcome.

The version 5 (attached) contains all discussed until now.

Regards.

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog: http://fabriziomello.github.io
>> Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello
>> Github: http://github.com/fabriziomello
Attachment

pgsql-hackers by date:

Previous
From: Claudio Freire
Date:
Subject: Re: [RFC] Incremental backup v2: add backup profile to base backup
Next
From: Bruce Momjian
Date:
Subject: Re: Fixed xloginsert_locks for 9.4