pgsql: introduce CopyFormat, refactor CopyFormatOptions - Mailing list pgsql-committers

From Andrew Dunstan
Subject pgsql: introduce CopyFormat, refactor CopyFormatOptions
Date
Msg-id E1w3Z9v-000dj2-1l@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
introduce CopyFormat, refactor CopyFormatOptions

Currently, the COPY command format is determined by two boolean fields
(binary, csv_mode) in CopyFormatOptions.  This approach, while
functional, isn't ideal for implementing other formats in the future.

To simplify adding new formats, introduce a CopyFormat enum.  This makes
the code cleaner and more maintainable, allowing for easier integration
of additional formats down the line.

Author: Joel Jacobson <joel@compiler.org>
Author: jian he <jian.universality@gmail.com>
Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
Discussion: https://postgr.es/m/CALvfUkBxTYy5uWPFVwpk_7ii2zgT07t3d-yR_cy4sfrrLU%3Dkcg%40mail.gmail.com
Discussion: https://postgr.es/m/6a04628d-0d53-41d9-9e35-5a8dc302c34c@joeconway.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a2145605ee3d92faccd769010059b110c44104ff

Modified Files
--------------
src/backend/commands/copy.c          | 50 +++++++++++++++++++-----------------
src/backend/commands/copyfrom.c      |  6 ++---
src/backend/commands/copyfromparse.c |  7 ++---
src/backend/commands/copyto.c        |  8 +++---
src/include/commands/copy.h          | 13 ++++++++--
src/tools/pgindent/typedefs.list     |  1 +
6 files changed, 49 insertions(+), 36 deletions(-)


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: pgsql: Cleanup users and roles in graph_table_rls test
Next
From: Robert Haas
Date:
Subject: pgsql: test_plan_advice: Set TAP test priority 50 in meson.build.