Add infrastructure for pg_get_*_ddl functions Add parse_ddl_options(), append_ddl_option(), and append_guc_value() helper functions in a new ddlutils.c file that provide common option parsing and output formatting for the pg_get_*_ddl family of functions which will follow in later patches. These accept VARIADIC text arguments as alternating name/value pairs.
Callers declare an array of DdlOption descriptors specifying the accepted option names and their types (boolean, text, or integer). parse_ddl_options() matches each supplied pair against the array, validates the value, and fills in the result fields. This descriptor-based scheme is based on an idea from Euler Taveira. This is placed in a new ddlutils.c file which will contain the pg_get_*_ddl functions. Author: Akshay Joshi <[email protected]> Co-authored-by: Andrew Dunstan <[email protected]> Co-authored-by: Euler Taveira <[email protected]> Discussion: https://postgr.es/m/CAKWEB6rmnmGKUA87Zmq-s=b3scsnj02c0kobqjnbl2ajfpw...@mail.gmail.com Discussion: https://postgr.es/m/[email protected] Discussion: https://postgr.es/m/canxoldc6fhbyjvcgonzys+jf0nuo3lq_83-rttbujgs9id_...@mail.gmail.com Discussion: https://postgr.es/m/[email protected] Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/4881981f92024e4db6249bd3dc96a3859638a665 Modified Files -------------- src/backend/utils/adt/Makefile | 1 + src/backend/utils/adt/ddlutils.c | 275 ++++++++++++++++++++++++++++++++++++++ src/backend/utils/adt/meson.build | 1 + src/tools/pgindent/typedefs.list | 4 +- 4 files changed, 280 insertions(+), 1 deletion(-)
