exposing COPY API

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема exposing COPY API
Дата
Msg-id 4D4B4CF8.4020403@dunslane.net
обсуждение исходный текст
Ответы Re: exposing COPY API  (Itagaki Takahiro <itagaki.takahiro@gmail.com>)
Список pgsql-hackers
Revisiting this, it occurred to me that I could achieve what I need of 
we extend the proposed API a bit. Currently, it has:
   extern CopyState BeginCopyFrom(Relation rel, const char *filename,                                   List
*attnamelist,List *options);
 


I'd like to be able to add a callback function to construct the values 
for the tuple. So it would become something like:
   typedef void (*copy_make_values) (CopyState cstate, NumFieldsRead int);
   extern CopyState BeginCopyFrom(Relation rel, const char *filename,                                   List
*attnamelist,List *options,                                    copy_make_values custom_values_func);
 


If custom_values_func were NULL (as it would be if using the builtin 
COPY), then the builtin code would be run to construct the values for 
making tuple. If not null, the function would be called.

Of course, I want this so I could construct a text array from the read 
in data, but I could also imagine a foreign data wrapper wanting to 
mangle the data before handing it to postgres, say by filling in a field 
or hashing it.

The intrusiveness of this would be very small, I think.

Thoughts?

cheers

andrew


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Noah Misch
Дата:
Сообщение: Re: Per-column collation, the finale
Следующее
От: Alex Hunsaker
Дата:
Сообщение: Re: arrays as pl/perl input arguments [PATCH]