Re: Fixes for missing schema qualifications

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Fixes for missing schema qualifications
Дата
Msg-id 20180314015439.GG1150@paquier.xyz
обсуждение исходный текст
Ответ на Re: Fixes for missing schema qualifications  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список 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

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Fixes for missing schema qualifications
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: neqjoinsel versus "refresh materialized view concurrently"