COPY FROM needs better example

From: PG Doc comments form <noreply(at)postgresql(dot)org>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Cc: joe(at)nahmias(dot)net
Subject: COPY FROM needs better example
Date: 2019-11-20 17:55:09
Message-ID: 157427250984.7229.11070726402485602790@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:

The example shown for COPY FROM is very basic and doesn't show how to use
any of the options -- which have tricky syntax that seems to trip up a
number of people.

Some suggestions:

COPY my_table FROM my_table.csv WITH (FORMAT csv, ESCAPE '\', HEADER,
ENCODING win1251);
COPY tbl (id, color) FROM STDIN WITH (FORMAT text, ENCODING utf8, DELIMITER
'|', FREEZE);
1|Brown
2|Purple
3|Maroon

Thanks,
--Joe

Browse pgsql-docs by date

  From Date Subject
Next Message Tatsuo Ishii 2019-11-21 00:08:58 standalone-install.xml
Previous Message Tom Lane 2019-11-20 17:27:56 Re: Role membership and DROP