| From: | Andrew Dunstan <andrew(at)dunslane(dot)net> | 
|---|---|
| To: | Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com> | 
| Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> | 
| Subject: | Re: textarray option for file FDW | 
| Date: | 2011-01-15 18:38:27 | 
| Message-ID: | 4D31E9A3.4010900@dunslane.net | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
On 01/15/2011 01:24 PM, Itagaki Takahiro wrote:
> On Sun, Jan 16, 2011 at 02:29, Andrew Dunstan<andrew(at)dunslane(dot)net>  wrote:
>> "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).
>>
>>    CREATE FOREIGN TABLE arr_text (
>>         t text[]
>>    )  SERVER file_server
>>    OPTIONS (format 'csv', filename '/path/to/ragged.csv', textarray 'true');
> FOREIGN TABLE has stable definitions, so there are some issues
> that doesn't exist in COPY command:
> - when the type of the last column is not a text[]
> - when the last column is changed by ALTER FOREIGN TABLE ADD/DROP COLUMN
I intended that this would be checked for validity at runtime, in 
BeginCopy(). If the table doesn't match the requirement an error would 
be raised. I don't think it's a big problem.
> BTW, those options could be specified in column options rather than table
> options. But we don't have column option syntax in the current proposal.
>
>    CREATE FOREIGN TABLE arr_text (
>         i integer OPTION (column 1), -- column position in csv file
>         t text[]  OPTION (column 'all the rest'),
>         d date    OPTION (column 2)
>    )  SERVER file_server
>    OPTIONS (format 'csv', filename '/path/to/ragged.csv');
Well, ok, but is there any proposal on the table to do that?
cheers
andrew
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Magnus Hagander | 2011-01-15 18:42:06 | Re: Visual Studio 2010/Windows SDK 7.1 support | 
| Previous Message | Magnus Hagander | 2011-01-15 18:30:34 | Re: Streaming base backups |