Re: Some message fixes

2018-03-07 Thread Kyotaro HORIGUCHI
At Wed, 7 Mar 2018 07:10:34 -0300, Alvaro Herrera  
wrote in <20180307101034.l7z7kqwqfkjg6c2p@alvherre.pgsql>
> Kyotaro HORIGUCHI wrote:
> 
> > 1. some messages are missing partitioned table/index
..
> I *think* the idea here is that a partitioned table is a table, so there
> is no need to say "foo is not a table or partitioned table".  We only
> mention partitioned tables when we want to make a distinction between
> those that are partitioned and those that aren't.

I agree with the direction and code seems following that. I
should have looked wider.

Thanks.

> > 2. GUC comment for autovacuum_work_mem has a typo, "max num of
> >parallel workers *than* can be..". (Third attached)
> 
> Yeah, pushed, though it's parallel_max_workers not autovacuum_work_mem.

Ugg. Inconsistency within a line.. My fingers may have decided to
do somewhat different from my brain.

Anyway, thank you for commiting.

regards,

-- 
Kyotaro Horiguchi
NTT Open Source Software Center




Re: Some message fixes

2018-03-07 Thread Alvaro Herrera
Kyotaro HORIGUCHI wrote:

> 1. some messages are missing partitioned table/index
> 
>   The first attached. I'm not sure how the orering ought to be
>   but I arranged them in mainly in the appearance order in if()
>   conditions, or the order of case label in switch()
>   construct. One exception is ATExecChangeOwner, in which the
>   order is the others regardless of the case label order just
>   above.
> 
>   This is backpatchable to 10 but 10 doesn't have partitioned
>   index so needs a different fix (Second attached).
> 
>   # But, I'm not sure if the list may be that long...

I *think* the idea here is that a partitioned table is a table, so there
is no need to say "foo is not a table or partitioned table".  We only
mention partitioned tables when we want to make a distinction between
those that are partitioned and those that aren't.

Same with indexes.

> 2. GUC comment for autovacuum_work_mem has a typo, "max num of
>parallel workers *than* can be..". (Third attached)

Yeah, pushed, though it's parallel_max_workers not autovacuum_work_mem.

-- 
Álvaro Herrerahttps://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



Some message fixes

2018-03-06 Thread Kyotaro HORIGUCHI
Hello.

While translating message catalogs, I found that some messages
listing object names are missing partitioned tables/indices.
And GUC comment for autovacuum_work_mem has a typo.

1. some messages are missing partitioned table/index

  The first attached. I'm not sure how the orering ought to be
  but I arranged them in mainly in the appearance order in if()
  conditions, or the order of case label in switch()
  construct. One exception is ATExecChangeOwner, in which the
  order is the others regardless of the case label order just
  above.

  This is backpatchable to 10 but 10 doesn't have partitioned
  index so needs a different fix (Second attached).

  # But, I'm not sure if the list may be that long...

2. GUC comment for autovacuum_work_mem has a typo, "max num of
   parallel workers *than* can be..". (Third attached)

regards,  

-- 
Kyotaro Horiguchi
NTT Open Source Software Center
diff --git a/src/backend/commands/comment.c b/src/backend/commands/comment.c
index 2f2e69b4a8..37b88b35ea 100644
--- a/src/backend/commands/comment.c
+++ b/src/backend/commands/comment.c
@@ -98,7 +98,7 @@ CommentObject(CommentStmt *stmt)
 relation->rd_rel->relkind != RELKIND_PARTITIONED_TABLE)
 ereport(ERROR,
 		(errcode(ERRCODE_WRONG_OBJECT_TYPE),
-		 errmsg("\"%s\" is not a table, view, materialized view, composite type, or foreign table",
+		 errmsg("\"%s\" is not a table, view, materialized view, composite type, foreign table, or partitioned table",
 RelationGetRelationName(relation;
 			break;
 		default:
diff --git a/src/backend/commands/seclabel.c b/src/backend/commands/seclabel.c
index 5ee46905d8..06f99efaf9 100644
--- a/src/backend/commands/seclabel.c
+++ b/src/backend/commands/seclabel.c
@@ -114,7 +114,7 @@ ExecSecLabelStmt(SecLabelStmt *stmt)
 relation->rd_rel->relkind != RELKIND_PARTITIONED_TABLE)
 ereport(ERROR,
 		(errcode(ERRCODE_WRONG_OBJECT_TYPE),
-		 errmsg("\"%s\" is not a table, view, materialized view, composite type, or foreign table",
+		 errmsg("\"%s\" is not a table, view, materialized view, composite type, foreign table, or partitioned table",
 RelationGetRelationName(relation;
 			break;
 		default:
diff --git a/src/backend/commands/sequence.c b/src/backend/commands/sequence.c
index ef3ca8c00b..932237477d 100644
--- a/src/backend/commands/sequence.c
+++ b/src/backend/commands/sequence.c
@@ -1671,7 +1671,7 @@ process_owned_by(Relation seqrel, List *owned_by, bool for_identity)
 			  tablerel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE))
 			ereport(ERROR,
 	(errcode(ERRCODE_WRONG_OBJECT_TYPE),
-	 errmsg("referenced relation \"%s\" is not a table or foreign table",
+	 errmsg("referenced relation \"%s\" is not a table, foreign table, view, or partitioned table",
 			RelationGetRelationName(tablerel;
 
 		/* We insist on same owner and schema */
diff --git a/src/backend/commands/statscmds.c b/src/backend/commands/statscmds.c
index c4adfd569e..c254bd33fe 100644
--- a/src/backend/commands/statscmds.c
+++ b/src/backend/commands/statscmds.c
@@ -117,7 +117,7 @@ CreateStatistics(CreateStatsStmt *stmt)
 			rel->rd_rel->relkind != RELKIND_PARTITIONED_TABLE)
 			ereport(ERROR,
 	(errcode(ERRCODE_WRONG_OBJECT_TYPE),
-	 errmsg("relation \"%s\" is not a table, foreign table, or materialized view",
+	 errmsg("relation \"%s\" is not a table, foreign table, materialized view, foreign table, or partitioned table",
 			RelationGetRelationName(rel;
 
 		/* You must own the relation to create stats on it */
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 74e020bffc..fce9208319 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -1889,7 +1889,7 @@ MergeAttributes(List *schema, List *supers, char relpersistence,
 			relation->rd_rel->relkind != RELKIND_PARTITIONED_TABLE)
 			ereport(ERROR,
 	(errcode(ERRCODE_WRONG_OBJECT_TYPE),
-	 errmsg("inherited relation \"%s\" is not a table or foreign table",
+	 errmsg("inherited relation \"%s\" is not a table, foreign table, or partitioned table",
 			parent->relname)));
 		/* Permanent rels cannot inherit from temporary ones */
 		if (relpersistence != RELPERSISTENCE_TEMP &&
@@ -2596,7 +2596,7 @@ renameatt_check(Oid myrelid, Form_pg_class classform, bool recursing)
 		relkind != RELKIND_PARTITIONED_TABLE)
 		ereport(ERROR,
 (errcode(ERRCODE_WRONG_OBJECT_TYPE),
- errmsg("\"%s\" is not a table, view, materialized view, composite type, index, or foreign table",
+ errmsg("\"%s\" is not a table, view, materialized view, composite type, index, partitioned index, foreign table, or partitioned table",
 		NameStr(classform->relname;
 
 	/*
@@ -6285,7 +6285,7 @@ ATPrepSetStatistics(Relation rel, const char *colName, int16 colNum, Node *newVa
 		rel->rd_rel->relkind != RELKIND_PARTITIONED_TABLE)
 		ereport(ERROR,
 (errcode(ERRCODE_WRONG_OBJECT_TYPE),
- errmsg("\"%