1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-03 15:22:11 +03:00

Refine the guidelines for rmgrdesc authors.

Clarify the goals of the recently added guidelines for rmgrdesc authors:
to avoid gratuitous inconsistencies across resource managers, and to
make it reasonably easy to write a reusable custom parser.

Beyond that, the guidelines leave rmgrdesc authors with a significant
amount of leeway.  This even includes the leeway to invent custom
conventions (in cases where it's warranted).

Follow-up to commit 7d8219a4.

Author: Peter Geoghegan <pg@bowt.ie>
Reviewed-By: Melanie Plageman <melanieplageman@gmail.com>
Discussion: https://postgr.es/m/CAH2-WzkbYuvwYKm-Y-72QEh6SPMQcAo9uONv+mR3bMGcu9E_Cg@mail.gmail.com
This commit is contained in:
Peter Geoghegan
2023-04-11 15:26:24 -07:00
parent 96149a180d
commit c03c2eae0a
2 changed files with 44 additions and 20 deletions

View File

@@ -16,26 +16,6 @@
#include "access/rmgrdesc_utils.h"
#include "storage/off.h"
/*
* Guidelines for formatting desc functions:
*
* member1_name: member1_value, member2_name: member2_value
*
* If the value is a list, please use:
*
* member3_name: [ member3_list_value1, member3_list_value2 ]
*
* The first item appended to the string should not be prepended by any spaces
* or comma, however all subsequent appends to the string are responsible for
* prepending themselves with a comma followed by a space.
*
* 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.
*
* Composite objects in a list should be surrounded with { }.
*/
void
array_desc(StringInfo buf, void *array, size_t elem_size, int count,
void (*elem_desc) (StringInfo buf, void *elem, void *data),