Re: Add header support to text format and matching feature

Поиск
Список
Период
Сортировка
От Rémi Lapeyre
Тема Re: Add header support to text format and matching feature
Дата
Msg-id 07891B9D-2140-4C06-AF96-C14F1E1B0E8E@lenstra.fr
обсуждение исходный текст
Ответ на Re: Add header support to text format and matching feature  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Ответы Re: Add header support to text format and matching feature  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Список pgsql-hackers
> On 28 Jan 2022, at 09:57, Peter Eisentraut <peter.eisentraut@enterprisedb.com> wrote:
>
> On 31.12.21 18:36, Rémi Lapeyre wrote:
>> Here’s an updated version of the patch that takes into account the changes in d1029bb5a2. The actual code is the
sameas v10 which was already marked as ready for committer. 
>
> I have committed the 0001 patch.  I will work on the 0002 patch next.
>

Thanks!

> I notice in the 0002 patch that there is no test case for the error "wrong header for column \"%s\": got \"%s\"",
whichI think is really the core functionality of this patch.  So please add that. 
>

I added a test for it in this new version of the patch.

> I wonder whether the header matching should be a separate option from the HEADER option.  The option parsing in this
patchis quite complicated and could be simpler if there were two separate options.  It appears this has been mentioned
inthe thread but not fully discussed. 

I suppose a new option could be added but I’m not sure it would simplify things much with regard to the code and in my
opinionit would be a bit weirder for users, right now it is just: 

    copy my_table from stdin with (header match);

with an additional option it could be:

    copy my_table from stdin with (header true,  match);

with potentially “header true” being implicit when “match” is given:

    copy my_table from stdin with (match);

But I think we would still have to check for and return an error if the user inputs:

    copy my_table from stdin with (header off, match);


Rather than complicating things, the current implementation seemed to be the best but I will update the patch if you
thinkI should change it. 

Best regards,
Rémi


Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: pg_basebackup WAL streamer shutdown is bogus - leading to slow tests
Следующее
От: Noah Misch
Дата:
Сообщение: Re: plperl on windows