Index: copy.sgml =================================================================== RCS file: /projects/cvsroot/pgsql/doc/src/sgml/ref/copy.sgml,v retrieving revision 1.70 diff -c -r1.70 copy.sgml *** copy.sgml 15 Oct 2005 20:12:33 -0000 1.70 --- copy.sgml 21 Dec 2005 17:04:08 -0000 *************** *** 26,31 **** --- 26,32 ---- [ [ WITH ] [ BINARY ] [ OIDS ] + [ LOCK ] [ DELIMITER [ AS ] 'delimiter' ] [ NULL [ AS ] 'null string' ] [ CSV [ HEADER ] *************** *** 39,44 **** --- 40,46 ---- [ BINARY ] [ HEADER ] [ OIDS ] + [ LOCK ] [ DELIMITER [ AS ] 'delimiter' ] [ NULL [ AS ] 'null string' ] [ CSV [ HEADER ] *************** *** 152,157 **** --- 154,176 ---- + LOCK + + + An ExclusiveLock will be taken on the table prior to execution. This will + prevent concurrent writes to the table, as well as preventing + VACUUM, CREATE INDEX and other DDL + commands. + + + With COPY FROM this option can be used to greatly + increase performance of data loading, in certain conditions. + (see Notes below). + + + + + delimiter *************** *** 332,337 **** --- 351,378 ---- happened well into a large copy operation. You may wish to invoke VACUUM to recover the wasted space. + + + With COPY FROM the is designed + to increase performance of data loads when no indexes are present and + the server does not have archive_command set. When those pre-conditions + are met, COPY FROM will not write WAL records for the + data being loaded. This will greatly increase performance for large data + loads. An ExclusiveLock is taken to prevent concurrent writes during this + operation. The option is available for + COPY TO also, but in that case does nothing to increase + performance. + + + + If the COPY FROM command is issued in the same + top level transaction as the command that created the target table, then + performance will also be enhanced, with or without the + option. This optimization will greatly enhance the speed of data recovery + from a pg_dump file or software upgrades that required a re-initdb. You can + take advantage of this easily using the + option on psql or pg_restore. +