Re: textarray option for file FDW - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: textarray option for file FDW
Date
Msg-id 4D31E27F.3030600@dunslane.net
Whole thread Raw
In response to Re: textarray option for file FDW  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

On 01/15/2011 12:44 PM, Tom Lane wrote:
> Andrew Dunstan<andrew@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


pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: patch: fix performance problems with repated decomprimation of varlena values in plpgsql
Next
From: Magnus Hagander
Date:
Subject: pg_basebackup for streaming base backups