Re: [HACKERS] Refactoring identifier checks to consistently use strcmp

Michael Paquier <michael.paquier@gmail.com>

From: Michael Paquier <michael.paquier@gmail.com>
To: Daniel Gustafsson <daniel@yesql.se>
Cc: Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Stephen Frost <sfrost@snowman.net>, Heikki Linnakangas <hlinnaka@iki.fi>, Alvaro Herrera <alvherre@2ndquadrant.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2018-01-24T01:37:49Z
Lists: pgsql-hackers
On Tue, Jan 23, 2018 at 04:22:22PM +0100, Daniel Gustafsson wrote:
> On 23 Jan 2018, at 05:52, Michael Paquier <michael.paquier@gmail.com> wrote:
>> 2) indexam.sgml mentions using pg_strcasecmp() for consistency with the
>> core code when defining amproperty for an index AM. Well, with this
>> patch I think that for consistency with the core code that would involve
>> using strcmp instead, extension developers can of course still use
>> pg_strcasecmp.
> 
> That part I’m less sure about, the propname will not be casefolded by the
> parser so pg_strcasecmp() should still be the recommendation here no?

Yes, you are right. I had a brain fade here as all the option names here
go through SQL-callable functions.

>> Those are changed as well in the attached, which applies on top of your
>> v6. I have added as well in it the tests I spotted were missing. If this
>> looks right to you, I am fine to switch this patch as ready for
>> committer, without considering the issues with isCachable and isStrict
>> in CREATE FUNCTION of course.
> 
> Apart from the amproperty hunk, I’m definately +1 on adding your patch on top
> of my v6 one.  Thanks for all your help and review!

OK. Could you publish a v7? I will switch the entry as ready for
committer.
--
Michael

Commits

  1. Avoid unnecessary use of pg_strcasecmp for already-downcased identifiers.