Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-06-19 Thread Michael Paquier
On Wed, Jun 19, 2019 at 11:29:37PM -0400, Alvaro Herrera wrote: > Looks good. Thanks for the review, and reminding me about it :) While on it, I have removed some comments around the error messages because they actually don't bring more information. -- Michael signature.asc Description: PGP sig

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-06-19 Thread Alvaro Herrera
On 2019-May-27, Michael Paquier wrote: > On Mon, May 27, 2019 at 12:20:58AM -0400, Alvaro Herrera wrote: > > I notice your patch changes "catalog relations" to "system catalogs". > > I think we predominantly prefer the latter, so that part of your change > > seems OK. (In passing, I noticed we h

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-29 Thread Robert Haas
On Mon, May 27, 2019 at 4:02 AM Michael Paquier wrote: > On Mon, May 27, 2019 at 12:20:58AM -0400, Alvaro Herrera wrote: > > I wonder if we really want to abolish all distinction between "cannot do > > X" and "Y is not supported". I take the former to mean that the > > operation is impossible to

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-27 Thread Michael Paquier
On Mon, May 27, 2019 at 12:20:58AM -0400, Alvaro Herrera wrote: > I wonder if we really want to abolish all distinction between "cannot do > X" and "Y is not supported". I take the former to mean that the > operation is impossible to do for some reason, while the latter means we > just haven't imp

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-26 Thread Alvaro Herrera
On 2019-May-27, Michael Paquier wrote: > On Wed, May 15, 2019 at 11:17:51AM +0900, Michael Paquier wrote: > > Perhaps something like the attached for the REINDEX portion would make > > the world a better place? What do you think? > > Alvaro, do you have extra thoughts about this patch improving

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-26 Thread Michael Paquier
On Wed, May 15, 2019 at 11:17:51AM +0900, Michael Paquier wrote: > Perhaps something like the attached for the REINDEX portion would make > the world a better place? What do you think? Alvaro, do you have extra thoughts about this patch improving the error message consistency for REINDEX CONCURRE

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-14 Thread Michael Paquier
On Tue, May 14, 2019 at 11:32:52AM -0400, Alvaro Herrera wrote: > I do :-) And actually I am happy to see somebody raising that point. The current log messages are quite inconsistent for a couple of years now but I did not bother changing anything other than the new strings per the feedback I got

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-14 Thread Alvaro Herrera
On 2019-May-09, Michael Paquier wrote: > On Wed, May 08, 2019 at 11:28:35PM -0400, Tom Lane wrote: > > Michael Paquier writes: > >> No problem to do that. I'll brush up all that once you commit the > >> first piece you have come up with, and reuse the new API of catalog.c > >> you are introducin

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-09 Thread Michael Paquier
On Thu, May 09, 2019 at 02:08:39PM -0400, Tom Lane wrote: > LGTM, thanks. Thanks for double-checking, committed. I am closing the open item. -- Michael signature.asc Description: PGP signature

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-09 Thread Tom Lane
Michael Paquier writes: > On Wed, May 08, 2019 at 11:28:35PM -0400, Tom Lane wrote: >> Pushed my stuff, have at it. > Thanks. Attached is what I get to after scanning the error messages > in indexcmds.c and index.c. Perhaps you have more comments about it? LGTM, thanks.

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-08 Thread Michael Paquier
On Wed, May 08, 2019 at 11:28:35PM -0400, Tom Lane wrote: > Michael Paquier writes: >> No problem to do that. I'll brush up all that once you commit the >> first piece you have come up with, and reuse the new API of catalog.c >> you are introducing based on the table OID. > > Pushed my stuff, ha

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-08 Thread Tom Lane
Michael Paquier writes: > No problem to do that. I'll brush up all that once you commit the > first piece you have come up with, and reuse the new API of catalog.c > you are introducing based on the table OID. Pushed my stuff, have at it. regards, tom lane

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-08 Thread Michael Paquier
On Wed, May 08, 2019 at 08:31:54AM -0400, Tom Lane wrote: > Michael Paquier writes: >> With IsCatalogClass() removed, the only dependency with Form_pg_class >> comes from IsToastClass() which is not used at all except in >> IsSystemClass(). Wouldn't it be better to remove entirely >> IsToastClass

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-08 Thread Tom Lane
Michael Paquier writes: > On Tue, May 07, 2019 at 05:19:38PM -0400, Tom Lane wrote: >> With this, the Form_pg_class argument to IsCatalogClass becomes >> vestigial. I'm tempted to get rid of that function altogether in >> favor of direct calls to IsCatalogRelationOid, but haven't done so >> in th

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-08 Thread Michael Paquier
On Tue, May 07, 2019 at 05:19:38PM -0400, Tom Lane wrote: > That's nothing but a hack, and the reason it's necessary is that > index_create will throw error if IsCatalogRelation is true, which > it will be for information_schema TOAST tables --- but not for their > parent tables that are being exam

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-07 Thread Tom Lane
I wrote: > After looking around a bit, I propose that we invent > "IsCatalogRelationOid(Oid reloid)" (not wedded to that name), which > is a wrapper around IsCatalogClass() that does the needful syscache > lookup for you. Aside from this use-case, it could be used in > sepgsql/dml.c, which I see i

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-07 Thread Michael Paquier
On Sun, May 05, 2019 at 05:45:53PM -0400, Tom Lane wrote: > In the other place, checking IsSystemNamespace isn't even > approximately the correct way to proceed, since it fails to reject > reindexing system catalogs' toast tables. Good point. I overlooked that part. It is easy enough to have a t

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-05 Thread Tom Lane
I wrote: > Michael Paquier writes: >> What do you think about something like the attached then? HEAD does >> not check after system indexes with REINDEX INDEX CONCURRENTLY, and I >> have moved all the catalog-related tests to reindex_catalog.sql. > OK as far as the wording goes, but now that I l

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-05 Thread Tom Lane
Michael Paquier writes: > The message you are referring to in index_create() has been introduced > as of e093dcdd with the introduction of CREATE INDEX CONCURRENTLY, and > it can be perfectly hit without REINDEX: > =# show allow_system_table_mods; > allow_system_table_mods > -

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-05 Thread Michael Paquier
On Sat, May 04, 2019 at 11:00:11AM -0400, Tom Lane wrote: > I'm not excited about rewording longstanding errors. These two are > new though (aren't they?) The message you are referring to in index_create() has been introduced as of e093dcdd with the introduction of CREATE INDEX CONCURRENTLY, and

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-04 Thread Tom Lane
Michael Paquier writes: > On Thu, May 02, 2019 at 10:06:42AM -0400, Tom Lane wrote: >> regression=# reindex index concurrently pg_class_oid_index; >> psql: ERROR: concurrent reindex is not supported for catalog relations >> regression=# reindex table concurrently pg_class; >> psql: ERROR: concu

Re: Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-04 Thread Michael Paquier
On Thu, May 02, 2019 at 10:06:42AM -0400, Tom Lane wrote: > In view of the REINDEX-on-pg_class kerfuffle that we're currently > sorting through, I was very glad to see that the concurrent reindex > code doesn't even try: > > regression=# reindex index concurrently pg_class_oid_index; > psql: ERROR

Inconsistent error message wording for REINDEX CONCURRENTLY

2019-05-02 Thread Tom Lane
In view of the REINDEX-on-pg_class kerfuffle that we're currently sorting through, I was very glad to see that the concurrent reindex code doesn't even try: regression=# reindex index concurrently pg_class_oid_index; psql: ERROR: concurrent reindex is not supported for catalog relations regressio