Re: Bug in reindexdb's error reporting
Julien Rouhaud <rjuju123@gmail.com>
From: Julien Rouhaud <rjuju123@gmail.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2019-05-10T15:58:03Z
Lists: pgsql-hackers
Attachments
- fix_error_reporting_reindexdb-v2.diff (text/x-patch) patch v2
On Fri, May 10, 2019 at 5:33 PM Alvaro Herrera <alvherre@2ndquadrant.com> wrote: > > On 2019-May-10, Julien Rouhaud wrote: > > > On Fri, May 10, 2019 at 4:43 PM Tom Lane <tgl@sss.pgh.pa.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.
Commits
-
Fix error reporting in reindexdb
- 82ed20e15e52 9.4.23 landed
- e17fba8d8f13 9.5.18 landed
- 0c132d4581c2 9.6.14 landed
- c6354e94304c 10.9 landed
- e16ab408f3db 11.4 landed
- e51bad8fb4c3 12.0 landed