On 01/15/2011 12:44 PM, Tom Lane wrote:
Andrew Dunstan<and...@dunslane.net>  writes:
... So now I'd like to add a
new option to it: "textarray". This option would require that the
foreign table have exactly one field, of type text[], and would compose
all the field strings read from the file for each record into the array
(however many there are).
Why is this a good thing?  It seems like it would accomplish little
except to defeat the SQL type system entirely.

                        


We have discussed previously allowing this sort of thing. It's not a new proposal at all.

My use case is that I have a customer who reads in data like this (using my patch to allow ragged CSV input, which you previously objected to) and then performs a sophisticated battery of validity tests on the data before loading it into its final destination. To do that their requirement is that we not error out on reading the data, so we load the data into a table that is all text fields.

In fact, having COPY read in a text array is *your* suggestion: <http://archives.postgresql.org/pgsql-hackers/2009-09/msg00547.php>. This is simply a proposal to implement that via FDW, which makes it easy to avoid any syntax issues.

cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to