FORMAT keyword not allowed in COPY ... FROM statement

From: PG Doc comments form <noreply(at)postgresql(dot)org>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Cc: sfbarbee(at)gmail(dot)com
Subject: FORMAT keyword not allowed in COPY ... FROM statement
Date: 2019-02-22 07:40:21
Message-ID: 155082122169.1372.13013704865070084381@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/11/sql-copy.html
Description:

> psql --version ;
psql (PostgreSQL) 11.2
> initdb --version ;
initdb (PostgreSQL) 11.2

# \h copy
Command: COPY
Description: copy data between a file and a table
Syntax:
COPY table_name [ ( column_name [, ...] ) ]
FROM { 'filename' | PROGRAM 'command' | STDIN }
[ [ WITH ] ( option [, ...] ) ]

COPY { table_name [ ( column_name [, ...] ) ] | ( query ) }
TO { 'filename' | PROGRAM 'command' | STDOUT }
[ [ WITH ] ( option [, ...] ) ]

where option can be one of:

FORMAT format_name
OIDS [ boolean ]
FREEZE [ boolean ]
DELIMITER 'delimiter_character'
NULL 'null_string'
HEADER [ boolean ]
QUOTE 'quote_character'
ESCAPE 'escape_character'
FORCE_QUOTE { ( column_name [, ...] ) | * }
FORCE_NOT_NULL ( column_name [, ...] )
FORCE_NULL ( column_name [, ...] )
ENCODING 'encoding_name'

# COPY table_name FROM '/srv/database/pg_dumps/file.csv' WITH FORMAT CSV
HEADER DELIMITER ',' QUOTE '"' ;
ERROR: syntax error at or near "FORMAT"

# COPY table_name FROM '/srv/database/pg_dumps/file.csv' WITH CSV HEADER
DELIMITER ',' QUOTE '"' ;
COPY 63

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message PG Doc comments form 2019-02-22 07:50:03 HEADER [ boolean ] not allowed in COPY ... FROM statement
Previous Message Bruce Momjian 2019-02-22 01:39:24 Re: Improve documentation for current_setting function