postgres-github.git / summary / log / commit / refs

commit    f30d0c720f2ec979ab1b5b44b1f9f201d6efdf8c
Author:   Andrew Dunstan <andrew@dunslane.net>
Date:     Wed Apr 15 11:47:12 2026 +0000

    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 7dadd38cda9.
    
    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

[parent: 3e2a1496bae6]