exposing COPY API
От
Andrew Dunstan
Тема
exposing COPY API
Дата
Msg-id
4D4B4CF8.4020403@dunslane.net
Список
Дерево обсуждения
exposing COPY API Andrew Dunstan <andrew@dunslane.net>
Re: exposing COPY API Itagaki Takahiro <itagaki.takahiro@gmail.com>
Re: exposing COPY API Andrew Dunstan <andrew@dunslane.net>
Re: exposing COPY API Itagaki Takahiro <itagaki.takahiro@gmail.com>
Re: exposing COPY API Andrew Dunstan <andrew@dunslane.net>
Re: exposing COPY API Itagaki Takahiro <itagaki.takahiro@gmail.com>
Re: exposing COPY API Andrew Dunstan <andrew@dunslane.net>
Re: exposing COPY API Itagaki Takahiro <itagaki.takahiro@gmail.com>
Re: exposing COPY API Andrew Dunstan <andrew@dunslane.net>
Re: exposing COPY API Andrew Dunstan <andrew@dunslane.net>
Re: exposing COPY API Andrew Dunstan <andrew@dunslane.net>
Re: exposing COPY API Itagaki Takahiro <itagaki.takahiro@gmail.com>
Re: exposing COPY API Shigeru HANADA <hanada@metrosystems.co.jp>
Re: exposing COPY API Robert Haas <robertmhaas@gmail.com>
Re: exposing COPY API Shigeru HANADA <hanada@metrosystems.co.jp>
Re: exposing COPY API Robert Haas <robertmhaas@gmail.com>
Re: exposing COPY API Andrew Dunstan <andrew@dunslane.net>
Re: exposing COPY API Robert Haas <robertmhaas@gmail.com>
Re: exposing COPY API Andrew Dunstan <andrew@dunslane.net>
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 по дате отправления