question on error during COPY FROM

From: Jerome Wagner <jerome(dot)wagner(at)laposte(dot)net>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: question on error during COPY FROM
Date: 2016-08-23 10:04:15
Message-ID: CA+=V_fMXz7Gecx4NVGUg1tA-wbt1PD+B-dn01vMKMw91bF4Cow@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

in the documentation I read
https://www.postgresql.org/docs/current/static/sql-copy.html

COPY stops operation at the first error. This should not lead to problems
in the event of a COPY TO, but the target table will already have received
earlier rows in a COPY FROM. These rows will not be visible or accessible,
but they still occupy disk space. This might amount to a considerable
amount of wasted disk space if the failure happened well into a large copy
operation. You might wish to invoke VACUUM to recover the wasted space.

does that mean that I should always execute a VACUUM to recover the wasted
space when an error is triggered or will the auto-vacuum mechanism do the
job by itself ?

Thanks
Jerome

Responses

Browse pgsql-general by date

  From Date Subject
Next Message pinker 2016-08-23 12:26:45 Re: Sequential vs. random values - number of pages in B-tree
Previous Message Adrian Klaver 2016-08-23 02:55:17 Re: Unique constraint on field inside composite type.