I am exporting a grass vectior dataset to a Postgis dump file using v.out.ogr (reformatted for clarity)
v.out.ogr -a -n input=my_layer@mapset\
output=my_sql_file.sql format=PGDUMP
It exports using insert statements by default, but the ogr2ogr docs suggest that using a switch enables COPY format instead (--config PG_USE_COPY YES). COPY is much faster and is also easier to debug when errors occur.
I tried using PG_USE_COPY=YES as both a dsco and lco option, and exporting it (ubuntu 18.04 command line in grass environment).
export PG_USE_COPY=YES
Is it possible to export using COPY format?
What am I doing wrong?
[edit]
My problem was caused by creating a layer by merging server datasets, one of which had an ogc_fid field (default primary key for ogr2ogr). This caused loading to fail after several thousand insert statements. I solved it by editing the sql file to rename the primary key and add ogc_fid as an integer field.