Re: is it possible to flush / commit / update underlying table during the COPY table FROM 'pipe' - Mailing list pgsql-novice

From Jon Jensen
Subject Re: is it possible to flush / commit / update underlying table during the COPY table FROM 'pipe'
Date
Msg-id CB451BCE-8AC5-46F3-BAF4-CF0314C305C0@jenseng.com
Whole thread Raw
In response to is it possible to flush / commit / update underlying table during the COPY table FROM 'pipe'  (Trent George <trent.george1@gmail.com>)
List pgsql-novice
On Mar 26, 2011, at 5:31 PM, Trent George wrote:

> Is it (or would it) be possible to allow some type of equivalent of
> BATCHSIZE as used in mssql BULK INSERT command
> This would group and commit this number of records during the import,
> while it is still running
> One could in theory use a value of =1, =1000 or leave the default (whole batch)

There is nothing built-in for what you describe, but you could accomplish the desired result on your end. e.g. split
theimport into batches of 1000 (or whatever) and issue individual COPY commands for each one. This could all be wrapped
intoa sh/perl/whatever script to make it reusable, configurable, add error handling, etc. 

Jon

pgsql-novice by date:

Previous
From: Trent George
Date:
Subject: is it possible to flush / commit / update underlying table during the COPY table FROM 'pipe'
Next
From: Francisco Leovey
Date:
Subject: Re: /etc/init.d/postgres-8.4-openscg start problem