You can already do that, natively in Linux/Mac & by adding some simple tools to try & make Windows useful:
cat <FILE> | grep <filter> | psql -d <DB> -c "copy ....;"
between grep, sed, tr, awk you can do almost any in-line filtering or text manipulation you are likely to need. Or a bit of Perl/Python...
Brent Wood
Programme leader: Environmental Information Delivery NIWA DDI: +64 (4) 3860529
From: pgsql-general-owner@xxxxxxxxxxxxxx <pgsql-general-owner@xxxxxxxxxxxxxx> on behalf of Nicolas Paris <niparisco@xxxxxxxxx>
Sent: Friday, May 22, 2015 8:33 AM To: Stefan Stefanov Cc: Forums postgresql Subject: Re: [GENERAL] About COPY command (and probably file fdw too)
Hi,
To me this would be great. Why not the ability to restrict lines too
COPY stafflist (userid, username, staffid)
FROM 'myfile.txt' WITH (FORMAT text, DELIMITER E'\t', COLUMNS (1, 2, 7), LINES(2:1000,2000:3000), ENCODING 'windows-1250')
=> subset of full data.
2015-05-21 22:25 GMT+02:00 Stefan Stefanov
<stefanov.sm@xxxxxx>:
|