Re: [PATCH] COPY command's data format option allows only lowercase csv, text or binary

2020-06-29 Thread Michael Paquier
On Thu, Jun 25, 2020 at 11:07:33AM +0900, Michael Paquier wrote: > 0d8c9c1 has introduced some in parse_basebackup_options() for the > new manifest option, and fe30e7e for AlterType(), no? Please forget this one. I had a moment of brain fade. Those have been added for the option values, and on t

Re: [PATCH] COPY command's data format option allows only lowercase csv, text or binary

2020-06-28 Thread Bharath Rupireddy
> As that shows, there's already a round of lowercasing done by the parser. > The only way that strcasecmp in copy.c would be useful is if you wanted to > accept things like > copy foo from stdin (format "CSV"); > I don't find that to be a terribly good idea. The normal implication > of qu

Re: [PATCH] COPY command's data format option allows only lowercase csv, text or binary

2020-06-24 Thread Michael Paquier
On Wed, Jun 24, 2020 at 12:55:22PM -0400, Tom Lane wrote: > Yeah, I'm sure there are a few inconsistencies. We previously made a > pass to get rid of pg_strcasecmp for anything that had been through > the parser's downcasing (commit fb8697b31) but I wouldn't be surprised > if that missed a few cas

Re: [PATCH] COPY command's data format option allows only lowercase csv, text or binary

2020-06-24 Thread Tom Lane
Robert Haas writes: > On Wed, Jun 24, 2020 at 10:27 AM Tom Lane wrote: >> More generally, though, why would we want to change this policy only >> here? I believe we're reasonably consistent about letting the parser >> do any required down-casing and then just checking keyword matches >> with str

Re: [PATCH] COPY command's data format option allows only lowercase csv, text or binary

2020-06-24 Thread Robert Haas
On Wed, Jun 24, 2020 at 10:27 AM Tom Lane wrote: > More generally, though, why would we want to change this policy only > here? I believe we're reasonably consistent about letting the parser > do any required down-casing and then just checking keyword matches > with strcmp. I've had the feeling

Re: [PATCH] COPY command's data format option allows only lowercase csv, text or binary

2020-06-24 Thread Tom Lane
Bharath Rupireddy writes: > COPY command's FORMAT option allows only all lowercase csv, text or > binary, this is true because strcmp is being used while parsing these > values. This is nonsense, actually: regression=# create table foo (f1 int); CREATE TABLE regression=# copy foo from stdin (for

[PATCH] COPY command's data format option allows only lowercase csv, text or binary

2020-06-24 Thread Bharath Rupireddy
Hi, COPY command's FORMAT option allows only all lowercase csv, text or binary, this is true because strcmp is being used while parsing these values. It would be nice if the uppercase or combination of lower and upper case format options such as CSV, TEXT, BINARY, Csv, Text, Binary so on. is also