Re: CopyReadLineText optimization revisited

Поиск
Список
Период
Сортировка
От Dimitri Fontaine
Тема Re: CopyReadLineText optimization revisited
Дата
Msg-id m2lj7s3u2s.fsf@hi-media.com
обсуждение исходный текст
Ответ на Re: CopyReadLineText optimization revisited  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Список pgsql-hackers
Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> Ok. If we have to, we can keep that, it just requires more
> programming. After searching for a \n, we can peek at the previous byte to
> check if it's a backslash (and if it is, the one before that to see if it's
> a backslash too, and so forth until we find a non-backslash).

That's what pgloader does to allow for non-quoted fields containing
escaped separator in some contrived input formats (UNLOAD from Informix,
I'm looking at you).

I guess the same kind of playing could be applied to CSV too, but it'd
be necessary to search back to the previous \n and count the QUOTE chars
you find. Which does not sound like a huge win, even if you remember the
state at the last quoted \n.

Fancy format parsing ain't fun.

Regards,
-- 
dim


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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: pg_subtrans keeps bloating up in the standby
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pg_subtrans keeps bloating up in the standby