Skip site navigation (1) Skip section navigation (2)

Re: pgsql: Add regression tests for CSV and \., and add

From: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
To: <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Add regression tests for CSV and \., and add
Date: 2005-12-28 15:45:55
Message-ID: 43446.68.143.134.146.1135784755.squirrel@www.dunslane.net (view raw or flat)
Thread:
Lists: pgsql-committers
Bruce Momjian said:
>> Now that I've woken up properly I realise that it's also just wrong -
>> it will miss the case we need to catch of the first column of a
>> multi-column line beginning with \. - just treat them all the same and
>> all will be well.
>>
>> Also, this test is suspicious:
>>
>>     strcmp(string, "\\.") == 0
>>
>> Don't we also want to quote it if the field reads \.x ?
>>     strncmp(string, "\\.",2) == 0
>> seems like it would be a better test.
>
> Have you looked at the regression tests I added?  \.x will no longer be
> interpreted as an end-of-data marker:
>

Oh. I didn't realise that part of the behaviour had changed. Does that alter
our robustness?

I still think it seems odd to quote the field depending on it being the only
field. That feels more inconsistent than quoting it whenever it is \.

But I guess it's a corner case that is hardly likely to happen in real life.


cheers

andrew



In response to

Responses

pgsql-committers by date

Next:From: Tom LaneDate: 2005-12-28 16:38:39
Subject: pgsql: Remove silly use of DLLIMPORT.
Previous:From: Bruce MomjianDate: 2005-12-28 15:36:20
Subject: Re: pgsql: Add regression tests for CSV and \., and add

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group