git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 0e87dfe) | patch
Add support for COPY TO callback functions
2022年10月11日 02:45:52 +0000 (11:45 +0900)
2022年10月11日 02:45:52 +0000 (11:45 +0900)
commit 9fcdf2c787ac6da330165ea3cd50ec5155943a2b
Add support for COPY TO callback functions

This is useful as a way for extensions to process COPY TO rows in the
way they see fit (say auditing, analytics, backend, etc.) without the
need to invoke an external process running as the OS user running the
backend through PROGRAM that requires superuser rights. COPY FROM
already provides a similar callback for logical replication. For COPY
TO, the callback is triggered when we are ready to send a row in
CopySendEndOfRow(), which is the same code path as when sending a row
to a frontend or a pipe/file.

A small test module, test_copy_callbacks, is added to provide some
coverage for this facility.

Author: Bilva Sanaba, Nathan Bossart
Discussion: https://postgr.es/m/253C21D1-FCEB-41D9-A2AF-E6517015B7D7@amazon.com
14 files changed:
src/backend/commands/copy.c diff | blob | blame | history
src/backend/commands/copyto.c diff | blob | blame | history
src/include/commands/copy.h diff | blob | blame | history
src/test/modules/Makefile diff | blob | blame | history
src/test/modules/meson.build diff | blob | blame | history
src/test/modules/test_copy_callbacks/.gitignore [new file with mode: 0644] blob
src/test/modules/test_copy_callbacks/Makefile [new file with mode: 0644] blob
src/test/modules/test_copy_callbacks/expected/test_copy_callbacks.out [new file with mode: 0644] blob
src/test/modules/test_copy_callbacks/meson.build [new file with mode: 0644] blob
src/test/modules/test_copy_callbacks/sql/test_copy_callbacks.sql [new file with mode: 0644] blob
src/test/modules/test_copy_callbacks/test_copy_callbacks--1.0.sql [new file with mode: 0644] blob
src/test/modules/test_copy_callbacks/test_copy_callbacks.c [new file with mode: 0644] blob
src/test/modules/test_copy_callbacks/test_copy_callbacks.control [new file with mode: 0644] blob
src/tools/pgindent/typedefs.list diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /