Re: record identical operator - Mailing list pgsql-hackers

From Andres Freund
Subject Re: record identical operator
Date
Msg-id 20130916180542.GH5249@awork2.anarazel.de
Whole thread Raw
In response to Re: record identical operator  (Kevin Grittner <kgrittn@ymail.com>)
Responses Re: record identical operator
List pgsql-hackers
On 2013-09-16 10:58:01 -0700, Kevin Grittner wrote:
> Andres Freund <andres@2ndquadrant.com> wrote:
> > On 2013-09-16 10:46:53 -0700, Kevin Grittner wrote:
> >> I don't recall seeing anyone posting
> >> regarding the existing undocumented record comparison operators.
> >> Nor do I recall seeing anyone posting about the undocumented
> >> pattern comparison operators.
> >
> > I've used and have seen them being used in client code...
> 
> Which, the record operators or the text pattern operators (which
> ignore collations and multi-byte character considerations and just
> use memcmp())?

I was referring to the text pattern ops. But I've seen the record ones
as well.

>
http://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/backend/utils/adt/varlena.c;h=5e2c2ddc532c604a05f365f0cf6761033a35be76;hb=master#l1719
> 
> Is the fact that you have seen them used in client code even though
> they are not documented an argument for or against adding
> documentation for them?

Neither. It's an argument that providing operators with confusing
behaviours will not go unnoticed/unused.

I don't really think the record identical and pattern ops situations are
comparable. The latter has a well defined behaviour (using the C locale
basically) and is only useable for types where it's well defined. The
proposed identical operator returns false for comparisons of actually
equal data, that's quite different imo.

Greetings,

Andres Freund

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



pgsql-hackers by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: record identical operator
Next
From: Merlin Moncure
Date:
Subject: Re: record identical operator