[MDEV-12879] Please add support for exporting column headers to CSV Created: 2017-05-23  Updated: 2022-10-28

Status: Open
Project: MariaDB Server
Component/s: None
Fix Version/s: None

Type: Task Priority: Minor
Reporter: Jared Beck Assignee: Unassigned
Resolution: Unresolved Votes: 4
Labels: None

Issue Links:
Relates
relates to MDEV-29889 mysqldump --tab --header is slow Closed

 Description   

select .. into outfile works great, but there doesn't seem to be a way to include column headers. Some creative workarounds have been proposed on SO (https://stackoverflow.com/questions/5941809/include-headers-when-using-select-into-outfile) but nothing convenient.

In postgres, as you probably know, export is done with the copy command. Here are their docs (https://www.postgresql.org/docs/current/static/sql-copy.html) though I'm not sure how useful they are to us here.

I wanted this to have Issue Type = New Feature, but the only option Jira gave me was "Bug". Please feel free to change any of that metadata as you see fit.



 Comments   
Comment by Manjot Singh (Inactive) [ 2020-08-31 ]

One way could be adding syntax around OUTFILE for specifying headers,

perhaps, SELECT .. INTO OUTFILE WITH HEADERS or something of that nature.

Generated at Thu Feb 08 08:01:12 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.