Re: CREATE IF NOT EXISTS INDEX

From: Fabrízio de Royes Mello <fabriziomello(at)gmail(dot)com>
To: Marti Raudsepp <marti(at)juffo(dot)org>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>, José Luis Tallón <jltallon(at)adv-solutions(dot)net>
Subject: Re: CREATE IF NOT EXISTS INDEX
Date: 2014-10-03 03:35:38
Message-ID: CAFcNs+qGoT0uRCL-f6-M=OQowQ=u8se4X=M1Dam-gHk4E0cwDA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Oct 3, 2014 at 12:29 AM, Fabrízio de Royes Mello <
fabriziomello(at)gmail(dot)com> wrote:
>
>
>
> On Thu, Oct 2, 2014 at 9:55 PM, Marti Raudsepp <marti(at)juffo(dot)org> wrote:
> >
> > On Fri, Oct 3, 2014 at 2:15 AM, Marti Raudsepp <marti(at)juffo(dot)org> wrote:
> > > + ereport(NOTICE,
> > > + (errcode(ERRCODE_DUPLICATE_TABLE),
> > > + errmsg("relation \"%s\" already exists, skipping",
> > > + indexRelationName)));
> > >
> > > 1. Clearly "relation" should be "index".
> > > 2. Use ERRCODE_DUPLICATE_OBJECT not TABLE
> >
> > My bad, this code is OK. The current code already uses "relation" and
> > TABLE elsewhere because indexes share the same namespace with tables.
> >
>
> Ok. I reply it in other message.
>
>
> > + /*
> > + * Throw an exception when IF NOT EXISTS is used without a named
> > + * index
> > + */
> >
> > I'd say "without an index name". And the line goes beyond 80 characters
wide.
> >
>
> Fixed and send in other reply...
>
>
> > 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...
>

And just to remember please add your review to commitfest [1] and change
the "patch status" to "Waiting on Author" when the author needs to
fix/change something.

Thanks for your review!

Regards,

[1] https://commitfest.postgresql.org/action/patch_view?id=1584

--
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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David G Johnston 2014-10-03 04:06:54 Re: proposal: doc: simplify examples of dynamic SQL
Previous Message Fabrízio de Royes Mello 2014-10-03 03:29:08 Re: CREATE IF NOT EXISTS INDEX