pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
FORMAT keyword not allowed in COPY ... FROM statement
2+ messages / 2 participants
[nested] [flat]

* FORMAT keyword not allowed in COPY ... FROM statement
@ 2019-02-22 07:40 PG Doc comments form <noreply@postgresql.org>
  2019-02-25 14:37 ` Re: FORMAT keyword not allowed in COPY ... FROM statement Euler Taveira <euler@timbira.com.br>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Doc comments form @ 2019-02-22 07:40 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org; +Cc: sfbarbee@gmail.com

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


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: FORMAT keyword not allowed in COPY ... FROM statement
  2019-02-22 07:40 FORMAT keyword not allowed in COPY ... FROM statement PG Doc comments form <noreply@postgresql.org>
@ 2019-02-25 14:37 ` Euler Taveira <euler@timbira.com.br>
  0 siblings, 0 replies; 2+ messages in thread

From: Euler Taveira @ 2019-02-25 14:37 UTC (permalink / raw)
  To: sfbarbee@gmail.com; pgsql-docs@lists.postgresql.org

Em sex, 22 de fev de 2019 às 06:31, PG Doc comments form
<noreply@postgresql.org> escreveu:
>
> The following documentation comment has been logged on the website:
> # COPY table_name FROM '/srv/database/pg_dumps/file.csv' WITH FORMAT CSV
> HEADER DELIMITER ',' QUOTE '"' ;
> ERROR:  syntax error at or near "FORMAT"
>
Your command is wrong. Please check synopsis in [1]. Use the new
syntax (options should be inside parentheses and separated by comma).

> # COPY table_name FROM '/srv/database/pg_dumps/file.csv' WITH CSV HEADER
> DELIMITER ',' QUOTE '"' ;
> COPY 63
>
This is the old syntax (check Compatibility section at the end of [1]).


[1] https://www.postgresql.org/docs/11/sql-copy.html


-- 
   Euler Taveira                                   Timbira -
http://www.timbira.com.br/
   PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2019-02-25 14:37 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-02-22 07:40 FORMAT keyword not allowed in COPY ... FROM statement PG Doc comments form <noreply@postgresql.org>
2019-02-25 14:37 ` Euler Taveira <euler@timbira.com.br>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox