Re: Bug in reindexdb's error reporting

2019-05-11 Thread Alvaro Herrera
On 2019-May-11, Julien Rouhaud wrote: > On Sat, May 11, 2019 at 2:09 PM Michael Paquier wrote: > > Also, as this thread's problem has been solved, perhaps it would be > > better to spawn a new thread, and to add a new entry in the CF app for > > the refactoring set so as it attracts the correct

Re: Bug in reindexdb's error reporting

2019-05-11 Thread Julien Rouhaud
On Sat, May 11, 2019 at 2:09 PM Michael Paquier wrote: > > On Sat, May 11, 2019 at 10:28:43AM +0200, Julien Rouhaud wrote: > > I attach the switch refactoring that applies on top of current HEAD, > > and the reindex_system_catalogs() removal in a different patch in case > > that's too much during

Re: Bug in reindexdb's error reporting

2019-05-11 Thread Michael Paquier
On Sat, May 11, 2019 at 10:28:43AM +0200, Julien Rouhaud wrote: > I attach the switch refactoring that applies on top of current HEAD, > and the reindex_system_catalogs() removal in a different patch in case > that's too much during feature freeze. Both Look fine to me at quick glance, but I have

Re: Bug in reindexdb's error reporting

2019-05-11 Thread Julien Rouhaud
On Sat, May 11, 2019 at 6:04 AM Michael Paquier wrote: > > On Fri, May 10, 2019 at 09:25:58PM -0400, Tom Lane wrote: > > Michael Paquier writes: > > > The refactoring bits are fine for HEAD. For back-branches I would > > > suggest using the simplest patch of upthread. > > > > Makes sense to me t

Re: Bug in reindexdb's error reporting

2019-05-10 Thread Michael Paquier
On Fri, May 10, 2019 at 09:25:58PM -0400, Tom Lane wrote: > Michael Paquier writes: > > The refactoring bits are fine for HEAD. For back-branches I would > > suggest using the simplest patch of upthread. > > Makes sense to me too. The refactoring is mostly to make future > additions easier, so

Re: Bug in reindexdb's error reporting

2019-05-10 Thread Tom Lane
Michael Paquier writes: > The refactoring bits are fine for HEAD. For back-branches I would > suggest using the simplest patch of upthread. Makes sense to me too. The refactoring is mostly to make future additions easier, so there's not much point for back branches. > That's perhaps too much g

Re: Bug in reindexdb's error reporting

2019-05-10 Thread Michael Paquier
On Fri, May 10, 2019 at 05:58:03PM +0200, Julien Rouhaud wrote: > On Fri, May 10, 2019 at 5:33 PM Alvaro Herrera > wrote: >> 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

Re: Bug in reindexdb's error reporting

2019-05-10 Thread Julien Rouhaud
On Fri, May 10, 2019 at 5:33 PM Alvaro Herrera wrote: > > On 2019-May-10, Julien Rouhaud wrote: > > > On Fri, May 10, 2019 at 4:43 PM Tom Lane 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,

Re: Bug in reindexdb's error reporting

2019-05-10 Thread Alvaro Herrera
On 2019-May-10, Julien Rouhaud wrote: > On Fri, May 10, 2019 at 4:43 PM Tom Lane 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 al

Re: Bug in reindexdb's error reporting

2019-05-10 Thread Julien Rouhaud
On Fri, May 10, 2019 at 4:43 PM Tom Lane wrote: > > Alvaro Herrera writes: > > On 2019-May-10, Julien Rouhaud wrote: > >> I just noticed that reindexdb could report an extraneous message > >> saying an error happened while reindexing a database if it failed > >> reindexing a table or an index. >

Re: Bug in reindexdb's error reporting

2019-05-10 Thread Tom Lane
Alvaro Herrera writes: > On 2019-May-10, Julien Rouhaud wrote: >> I just noticed that reindexdb could report an extraneous message >> saying an error happened while reindexing a database if it failed >> reindexing a table or an index. > Kudos, good find -- that's a 14 years old bug, introduced in

Re: Bug in reindexdb's error reporting

2019-05-10 Thread Alvaro Herrera
On 2019-May-10, Julien Rouhaud wrote: > I just noticed that reindexdb could report an extraneous message > saying an error happened while reindexing a database if it failed > reindexing a table or an index. Kudos, good find -- that's a 14 years old bug, introduced in this commit: Author: Bruce M

Re: Bug in reindexdb's error reporting

2019-05-10 Thread Daniel Gustafsson
> On 10 May 2019, at 12:24, Michael Paquier wrote: > > On Fri, May 10, 2019 at 11:02:52AM +0200, Julien Rouhaud wrote: >> I just noticed that reindexdb could report an extraneous message >> saying an error happened while reindexing a database if it failed >> reindexing a table or an index. >> >>

Re: Bug in reindexdb's error reporting

2019-05-10 Thread Michael Paquier
On Fri, May 10, 2019 at 11:02:52AM +0200, Julien Rouhaud wrote: > I just noticed that reindexdb could report an extraneous message > saying an error happened while reindexing a database if it failed > reindexing a table or an index. > > Trivial fix attached. Oops. That's true, nice catch. This

Bug in reindexdb's error reporting

2019-05-10 Thread Julien Rouhaud
Hi, I just noticed that reindexdb could report an extraneous message saying an error happened while reindexing a database if it failed reindexing a table or an index. Trivial fix attached. diff --git a/src/bin/scripts/reindexdb.c b/src/bin/scripts/reindexdb.c index d6f3efd313..897ad9a71a 100644 -