Case sensitive mode in windows build option

Lists: pgsql-hackers
From: Dilip kumar <dilip(dot)kumar(at)huawei(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Case sensitive mode in windows build option
Date: 2014-01-14 03:49:36
Message-ID: 4205E661176A124FAF891E0A6BA913526593CEB3@SZXEML507-MBS.china.huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


As per current behavior if user want to build in debug mode in windows, then he need to give debug in capital letters (DEBUG),
I think many user will always make mistake in giving this option, in my opinion we can make it case insensitive.

I have attached a small patch for the same ( just converted comparison to case insensitive).

Regards,
Dilip

Attachment Content-Type Size
windows_build.patch application/octet-stream 585 bytes

From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Dilip kumar <dilip(dot)kumar(at)huawei(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Case sensitive mode in windows build option
Date: 2014-01-14 05:55:16
Message-ID: 52D4D144.4060701@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 01/14/2014 11:49 AM, Dilip kumar wrote:
>
>
> As per current behavior if user want to build in debug mode in windows,
> then he need to give debug in capital letters (DEBUG),
>
> I think many user will always make mistake in giving this option, in my
> opinion we can make it case insensitive.

The idea seems reasonable, the implementation does not. You've changed
the meaning rather more than making it case insensitive.

Use the Perl 'lc' function to compare a lower-cased input instead.

http://perldoc.perl.org/functions/lc.html

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Dilip kumar <dilip(dot)kumar(at)huawei(dot)com>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Case sensitive mode in windows build option
Date: 2014-01-14 09:35:57
Message-ID: 4205E661176A124FAF891E0A6BA913526593D010@SZXEML507-MBS.china.huawei.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 01/14/2014 11:25 AM Craig Ringer Wrote,

> > As per current behavior if user want to build in debug mode in
> > windows, then he need to give debug in capital letters (DEBUG),
> >
> > I think many user will always make mistake in giving this option, in
> > my opinion we can make it case insensitive.
>
> The idea seems reasonable, the implementation does not. You've changed
> the meaning rather more than making it case insensitive.
>
> Use the Perl 'lc' function to compare a lower-cased input instead.
>
> http://perldoc.perl.org/functions/lc.html

I think I have done the same thing, converted user input to upper case and compared with DEBUG, so this will always give the case insensitive comparison.
Now we can input debug in any case (Debug, DEBUG, debug..) and it will work fine..

And for achieving this I used Perl 'uc' function to compare upper-cased input.

! if (uc($ARGV[0]) eq 'DEBUG')
{
$bconf = "Debug";
}

Will it make any difference if I use 'lc' instead of 'uc' ?

Please correct me if I have missed something here..

Regards,
Dilip


From: Craig Ringer <craig(at)2ndquadrant(dot)com>
To: Dilip kumar <dilip(dot)kumar(at)huawei(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Case sensitive mode in windows build option
Date: 2014-01-14 09:43:00
Message-ID: 52D506A4.6060409@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 01/14/2014 05:35 PM, Dilip kumar wrote:
> On 01/14/2014 11:25 AM Craig Ringer Wrote,
>
>>> As per current behavior if user want to build in debug mode in
>>> windows, then he need to give debug in capital letters (DEBUG),
>>>
>>> I think many user will always make mistake in giving this option, in
>>> my opinion we can make it case insensitive.
>>
>> The idea seems reasonable, the implementation does not. You've changed
>> the meaning rather more than making it case insensitive.
>>
>> Use the Perl 'lc' function to compare a lower-cased input instead.
>>
>> http://perldoc.perl.org/functions/lc.html
>
> I think I have done the same thing, converted user input to upper case and compared with DEBUG, so this will always give the case insensitive comparison.
> Now we can input debug in any case (Debug, DEBUG, debug..) and it will work fine..

You're completely right. My apologies. I'm not used to reading that
awful (IMO) context-diff format - despite it being the official standard
for PostgreSQL, I still misread it on a regular basis.

I saw:

! if (uc($ARGV[0]) eq 'DEBUG')
...
! elsif (uc($ARGV[0]) ne "RELEASE")

and thought "WTF?".

In fact, the WTF is all me.

Please disregard.

This seems quite sensible. Please add it to the commitfest app if it
isn't there already:

http://commitfest.postgresql.org/

and I'll sign up as a reviewer so I can do some build-testing on it
after the rather pressing deadline I've got in the next couple of days
has passed.

If you don't hear from me by Friday, poke me.

--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Dilip kumar <dilip(dot)kumar(at)huawei(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Case sensitive mode in windows build option
Date: 2014-01-23 17:24:33
Message-ID: 52E15051.90502@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 01/13/2014 10:49 PM, Dilip kumar wrote:
>
> As per current behavior if user want to build in debug mode in
> windows, then he need to give debug in capital letters (DEBUG),
>
> I think many user will always make mistake in giving this option, in
> my opinion we can make it case insensitive.
>
> I have attached a small patch for the same ( just converted comparison
> to case insensitive).
>
>

I have committed this. It's in the commitfest as a bug fix, but I don't
think it's strictly a bug. OTOH, it's pretty harmless. Do we want to
backpatch it?

cheers

andrew


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Dilip kumar <dilip(dot)kumar(at)huawei(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Case sensitive mode in windows build option
Date: 2014-01-23 18:36:45
Message-ID: 25837.1390502205@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> I have committed this. It's in the commitfest as a bug fix, but I don't
> think it's strictly a bug. OTOH, it's pretty harmless. Do we want to
> backpatch it?

Given the lack of field complaints, I'd say it's not worth the trouble.

regards, tom lane