COLUMN_NAMES
Include column names as the first row in raw output mode.
Keywords
columns, names, column_names
Syntax
columnsExamples
CSV with Headers
sql
create function export_users()
returns table(id int, name text, email text)
language sql
as $$select id, name, email from users$$;
comment on function export_users() is
'HTTP GET
raw
separator ,
new_line \n
columns
Content-Type: text/csv';Response:
id,name,email
1,John Doe,john@example.com
2,Jane Smith,jane@example.comTSV with Headers
sql
comment on function export_tsv() is
'HTTP GET
raw
separator \t
new_line \n
column_names';Related
- Comment Annotations Guide - How annotations work
- Configuration Guide - How configuration works