COLUMN_NAMES
Also known as
columns, names (with or without @ prefix)
Include column names as the first row in raw output mode.
Syntax
@columnsExamples
CSV with Headers
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
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