Allow COPY's 'text' format to output a header

From: Simon Muller <samullers(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Allow COPY's 'text' format to output a header
Date: 2018-05-13 22:18:38
Message-ID: CAF1-J-0PtCWMeLtswwGV2M70U26n4g33gpe1rcKQqe6wVQDrFA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

This patch adds the capability to use the HEADER feature with the "text"
format of the COPY command. The patch includes the related update to
documentation and an additional regression test for this feature.

Currently you can only add a header line (which lists the column names)
when exporting with COPY to the CSV format, but I much prefer using the
default "text" format. This feature is also currently listed on the to-do
list (https://wiki.postgresql.org/wiki/Todo#COPY) where it seems to have
been requested some years ago.

Hopefully I've done everything correctly and the patch is acceptable enough
to be considered for application.

Simon Muller

Attachment Content-Type Size
0001-Allow-COPY-s-text-format-to-output-a-header.patch application/octet-stream 3.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Steele 2018-05-13 23:01:00 Re: Allow COPY's 'text' format to output a header
Previous Message Tom Lane 2018-05-13 15:05:50 Re: Why does load_external_function() return PGFunction?