summaryrefslogtreecommitdiff
path: root/src/backend/access/rmgrdesc/rmgrdesc_utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/rmgrdesc/rmgrdesc_utils.c')
-rw-r--r--src/backend/access/rmgrdesc/rmgrdesc_utils.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/backend/access/rmgrdesc/rmgrdesc_utils.c b/src/backend/access/rmgrdesc/rmgrdesc_utils.c
index c95a41a254..3d16b1fcba 100644
--- a/src/backend/access/rmgrdesc/rmgrdesc_utils.c
+++ b/src/backend/access/rmgrdesc/rmgrdesc_utils.c
@@ -29,16 +29,11 @@
* or comma, however all subsequent appends to the string are responsible for
* prepending themselves with a comma followed by a space.
*
- * Arrays should have a space between the opening square bracket and first
- * element and between the last element and closing brace.
- *
* Flags should be in ALL CAPS.
*
* For lists/arrays of items, the number of those items should be listed at
* the beginning with all of the other numbers.
*
- * List punctuation should still be included even if there are 0 items.
- *
* Composite objects in a list should be surrounded with { }.
*/
void
@@ -51,16 +46,14 @@ array_desc(StringInfo buf, void *array, size_t elem_size, int count,
appendStringInfoString(buf, " []");
return;
}
- appendStringInfo(buf, " [");
+ appendStringInfoString(buf, " [");
for (int i = 0; i < count; i++)
{
- if (i > 0)
- appendStringInfoString(buf, ",");
- appendStringInfoString(buf, " ");
-
elem_desc(buf, (char *) array + elem_size * i, data);
+ if (i < count - 1)
+ appendStringInfoString(buf, ", ");
}
- appendStringInfoString(buf, " ]");
+ appendStringInfoString(buf, "]");
}
void
@@ -78,13 +71,7 @@ redirect_elem_desc(StringInfo buf, void *offset, void *data)
}
void
-relid_desc(StringInfo buf, void *relid, void *data)
+oid_elem_desc(StringInfo buf, void *relid, void *data)
{
appendStringInfo(buf, "%u", *(Oid *) relid);
}
-
-void
-uint16_elem_desc(StringInfo buf, void *value, void *data)
-{
- appendStringInfo(buf, "%u", *(uint16 *) value);
-}