[Gdal-dev] Improving postgresql performance by using COPY

Charlton Purvis cplist at earthlink.net
Fri Oct 14 09:46:32 EDT 2005


Hi, folks:

> How important do you think it is to be able to use COPY mode to
> add features to an existing table, as opposed to just using it to create

Sorry I'm coming into this late -- I didn't see the original msg. go by
before I hit del.  Bad me.

There is no doubt that COPY is lightening fast when compared to INSERT
statements.  But one disadvantage you have, especially when appending
incoming values to a table via ogr2ogr, is that if one row of a COPY fails,
the whole thing fails.  At least w/ INSERT statements, those that make it,
can, and those that don't simply error out.  And in previous use cases for
my work, failing was entirely OK (PK constraints), but I wanted the rest of
the operation to continue like normal.  So I wonder what it would look like
to an inexperienced user to see that a COPY failed if it were the fault of
only 1 row -- would they think the problem is in ogr since nothing went
through?  The DB?  

And I'm not sure COPYs are very robust across different DB platforms.

I absolutely vote for INSERTs to be the default.

Charlton





More information about the Gdal-dev mailing list