Re: BUG #1830: Non-super-user must be able to copy from a - Mailing list pgsql-bugs

From Oliver Jowett
Subject Re: BUG #1830: Non-super-user must be able to copy from a
Date
Msg-id 43053FDA.9000901@opencloud.com
Whole thread Raw
In response to Re: BUG #1830: Non-super-user must be able to copy from a  (Bernard <bht@actrix.gen.nz>)
Responses Re: BUG #1830: Non-super-user must be able to copy from a file  (Bernard <bht@actrix.gen.nz>)
List pgsql-bugs
Bernard wrote:

> This difference of performance is the main reason for the COPY
> command, and this is also the reason why bulk loading through the JDBC
> interface will never match the performance of the COPY fith files
> command.

In some admittedly unscientific tests I see less than 10% difference
between server-side COPY and client-side COPY FROM STDIN (psql's \copy
command) on a 28mb input file. That's down in the per-run noise.

Doing it via JDBC will undoubtably add some extra overhead, but I'd
estimate that it's about the same sort of overhead as writing your data
out to a file from Java in the first place takes.

If you've already got the data in a file, why not just use psql's \copy
command? This uses COPY FROM STDIN, reads the file as the user running
psql, and does not require superuser permissions.

> The whole architectural setup for such "bulk" loading is a mess.

Do you have a concrete suggestion for improving bulk loading that
doesn't open security holes?

-O

pgsql-bugs by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: BUG #1831: plperl gives error after reconnect.
Next
From: Oliver Jowett
Date:
Subject: Re: BUG #1830: Non-super-user must be able to copy from a