postgresql/src
Andrew Dunstan f30d0c720f Fix COPY TO FORMAT JSON to exclude generated columns.
COPY TO with FORMAT json was including generated columns in the
output, unlike TEXT and CSV formats.  Virtual generated columns
appeared as null, and stored ones showed their computed values.

The JSON code path only built a restricted TupleDesc when an explicit
column list was given (attnamelist != NIL), but CopyGetAttnums()
also excludes generated columns from the default list.  Fix by
checking whether the attnumlist is shorter than the full TupleDesc
instead.

Bug introduced in 7dadd38cda.

Author: Satya Narlapuram <satya.narlapuram@gmail.com>
Reviewed-by: Jian He <jian.universality@gmail.com>
Discussion: https://postgr.es/m/CAHg+QDcfpGDoPL3fvfjXRtfn=fny6DdJR6BAy6TpS1Xj2EZfXA@mail.gmail.com
2026-04-15 07:58:17 -04:00
..
backend Fix COPY TO FORMAT JSON to exclude generated columns. 2026-04-15 07:58:17 -04:00
bin Rework signal handler infrastructure to pass sender info as argument. 2026-04-15 07:30:34 -04:00
common Update Unicode data to CLDR 48.2 2026-04-13 11:13:36 +02:00
fe_utils Rework signal handler infrastructure to pass sender info as argument. 2026-04-15 07:30:34 -04:00
include Rework signal handler infrastructure to pass sender info as argument. 2026-04-15 07:30:34 -04:00
interfaces Rework signal handler infrastructure to pass sender info as argument. 2026-04-15 07:30:34 -04:00
makefiles Add CONCURRENTLY option to REPACK 2026-04-06 21:55:08 +02:00
pl Remove MULE_INTERNAL encoding. 2026-04-08 17:40:06 +12:00
port Rework signal handler infrastructure to pass sender info as argument. 2026-04-15 07:30:34 -04:00
template Switch the semaphore API on Solaris to unnamed POSIX. 2026-03-14 14:10:32 -04:00
test Fix COPY TO FORMAT JSON to exclude generated columns. 2026-04-15 07:58:17 -04:00
timezone Use fallthrough attribute instead of comment 2026-02-19 08:51:12 +01:00
tools Rework signal handler infrastructure to pass sender info as argument. 2026-04-15 07:30:34 -04:00
tutorial Force standard_conforming_strings to always be ON. 2026-01-21 15:08:38 -05:00
.gitignore
DEVELOPERS
Makefile Add CONCURRENTLY option to REPACK 2026-04-06 21:55:08 +02:00
Makefile.global.in Update Unicode data to CLDR 48.2 2026-04-13 11:13:36 +02:00
Makefile.shlib Restore AIX support. 2026-02-23 13:34:22 -05:00
meson.build Update copyright for 2026 2026-01-01 13:24:10 -05:00
nls-global.mk Fix update-po for the PGXS case 2025-10-16 20:21:05 +02:00