[MASSMAIL]Revise some error messages in split partition code - Mailing list pgsql-hackers

From Richard Guo
Subject [MASSMAIL]Revise some error messages in split partition code
Date
Msg-id CAMbWs49DDsknxyoycBqiE72VxzL_sYHF6zqL8dSeNehKPJhkKg@mail.gmail.com
Whole thread Raw
Responses Re: Revise some error messages in split partition code
List pgsql-hackers
I noticed some error messages in the split partition code that are not
up to par.  Such as:

"new partitions not have value %s but split partition has"

how about we revise it to:

"new partitions do not have value %s but split partition does"

Another one is:

"any partition in the list should be DEFAULT because split partition is
DEFAULT"

how about we revise it to:

"all partitions in the list should be DEFAULT because split partition is
DEFAULT"

Another problem I noticed is that in the test files partition_split.sql
and partition_merge.sql, there are comments specifying the expected
error messages for certain test queries.  However, in some cases, the
error message mentioned in the comment does not match the error message
actually generated by the query.  Such as:

-- ERROR:  invalid partitions order, partition "sales_mar2022" can not be merged
-- (space between sections sales_jan2022 and sales_mar2022)
ALTER TABLE sales_range MERGE PARTITIONS (sales_jan2022, sales_mar2022) INTO sales_jan_mar2022;
ERROR:  lower bound of partition "sales_mar2022" conflicts with upper bound of previous partition "sales_jan2022"

I'm not sure if it's a good practice to specify the expected error
message in the comment.  But if we choose to do so, I think we at least
need to ensure that the specified error message in the comment remains
consistent with the error message produced by the query.

Also there are some comments containing grammatical issues.  Such as:

-- no error: bounds of sales_noerror equals to lower and upper bounds of sales_dec2022 and sales_feb2022

Attached is a patch to fix the issues I've observed.  I suspect there
may be more to be found.

Thanks
Richard
Attachment

pgsql-hackers by date:

Previous
From: Etsuro Fujita
Date:
Subject: Re: postgres_fdw fails because GMT != UTC
Next
From: Andrew Dunstan
Date:
Subject: Re: WIP Incremental JSON Parser