Re: Bug in reindexdb's error reporting

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Bug in reindexdb's error reporting
Date: 2019-05-10 15:58:03
Message-ID: CAOBaU_b8KjhboSmbz+AbocHC4KypJLEL5dWn4WvUGi2_tvDBdA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 10, 2019 at 5:33 PM Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> wrote:
>
> On 2019-May-10, Julien Rouhaud wrote:
>
> > On Fri, May 10, 2019 at 4:43 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> > > Patch is good as far as it goes, but I wonder if it'd be smarter to
> > > convert the function's "type" argument from a string to an enum,
> > > and then replace the if/else chains with switches?
> >
> > I've also thought about it. I think the reason why type argument was
> > kept as a string is that reindex_one_database is doing:
> >
> > appendPQExpBufferStr(&sql, type);
> >
> > to avoid an extra switch to append the textual reindex type. I don't
> > have a strong opinion on whether to change that on master or not.
>
> I did have the same thought. It seem clear now that we should do it :-)
> ISTM that the way to fix that problem is to use the proposed enum
> everywhere and turn it into a string when generating the SQL command,
> not before.

ok :) Patch v2 attached.

Attachment Content-Type Size
fix_error_reporting_reindexdb-v2.diff text/x-patch 5.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashwin Agrawal 2019-05-10 17:43:44 Re: Inconsistency between table am callback and table function names
Previous Message Tom Lane 2019-05-10 15:38:57 Re: Why is infinite_recurse test suddenly failing?