Skip to content

COLUMN_NAMES

Include column names as the first row in raw output mode.

Keywords

columns, names, column_names

Syntax

columns

Examples

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

TSV with Headers

sql
comment on function export_tsv() is
'HTTP GET
raw
separator \t
new_line \n
column_names';

Released under the MIT License.