Re: Fixes for missing schema qualifications - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Fixes for missing schema qualifications
Date
Msg-id 20180314015439.GG1150@paquier.xyz
Whole thread Raw
In response to Re: Fixes for missing schema qualifications  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-hackers
On Tue, Mar 13, 2018 at 05:19:50PM -0700, David G. Johnston wrote:
> On Tue, Mar 13, 2018 at 5:11 PM, Tatsuo Ishii <ishii@sraoss.co.jp> wrote:
>> select pg_catalog.count(*) from pg_catalog.pg_namespace where
>> pg_catalog.nameeq(nspname, '%s');
>>
>>
> ​I'd rather write that:
>
> select [...] where nspname operator(pg_catalog.=) '%s'​
>
> Introducing undocumented implementation functions to these queries is
> undesirable; and besides, indexing and equivalence relies on operators and
> not the underlying functions so there would be some risk of performance
> issues if the functions were used directly.

Using directly the function calls calls under the wood of what an
operator does is a potential solution, though I would discard it as it
becomes harder for the reader to undertand that this is an operator.
Things become even more confusing when dealing with input parameters of
different types for simple maths like addition, multiplication or
division using several kinds of integers, leading to more complications
in maintaining this code in the future.  And the operator is careful
about doing proper casting itself.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Fixes for missing schema qualifications
Next
From: Jeff Janes
Date:
Subject: Re: neqjoinsel versus "refresh materialized view concurrently"