allow COPY routines to read arbitrary numbers of fields
Вложения
В списке pgsql-hackers по дате отправления:
| От | Andrew Dunstan |
|---|---|
| Тема | allow COPY routines to read arbitrary numbers of fields |
| Дата | |
| Msg-id | 4CFBD15B.8010000@dunslane.net обсуждение исходный текст |
| Ответы |
Re: allow COPY routines to read arbitrary numbers of fields
|
| Список | pgsql-hackers |
Attached is a patch that allows CopyReadAttibutesText() and
CopyReadAttributesCSV() to read arbitrary numbers of attributes.
Underflowing attributes are recorded as null, and space is made for
overflowing attributes on a line.
This patch doesn't result in any user-visible behavior. The current
calling code will fail if the number of attributes read is not what is
expected, as happens now. But it will allow the API to be used (when
exposed) by a foreign data wrapper that can accept arbitrary numbers of
attributes. My aim here is to get to something like:
CREATE FOREIGN TABLE my_csv (
t text[]
)
SERVER file_server
OPTIONS (format 'csv', filename '/path/to/my/data.csv', textarray
'true',
header 'true', delimiter ';', quote '@', escape '"', null '');
SELECT t[3] as f1, t[1] as f2, t[9999] as probably_null
FROM my_csv;
It would probably be nice to apply this before we start exposing the
COPY API to FDW routines, as discussed earlier today.
cheers
andrew
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера