]> git.ipfire.org Git - thirdparty/postgresql.git/commit
introduce CopyFormat, refactor CopyFormatOptions
authorAndrew Dunstan <andrew@dunslane.net>
Mon, 16 Mar 2026 20:49:01 +0000 (16:49 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Fri, 20 Mar 2026 12:21:57 +0000 (08:21 -0400)
commita2145605ee3d92faccd769010059b110c44104ff
treeccd34638c3b7cff0a5fa1524d711e508dc5303cc
parent040a56be4bcc88cad98f092970a8c6521263bba1
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
src/backend/commands/copy.c
src/backend/commands/copyfrom.c
src/backend/commands/copyfromparse.c
src/backend/commands/copyto.c
src/include/commands/copy.h
src/tools/pgindent/typedefs.list