Re: psql: Add leakproof field to \dAo+ meta-command results

From: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Erik Wienhold <ewie(at)ewie(dot)name>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: psql: Add leakproof field to \dAo+ meta-command results
Date: 2024-11-15 09:55:04
Message-ID: 20241115185504.1949cfcfa8b9c2b23fd0dc1f@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 4 Nov 2024 11:00:41 +0000
Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> wrote:

> > On 2024-07-01 15:08 +0200, Yugo NAGATA wrote:
> > I would like to propose to add a new field to psql's \dAo+ meta-command
> > to show whether the underlying function of an operator is leak-proof.
> >
>
> I agree that this is useful information to have, but why add it to
> \dAo+ instead of \do+? Taking the example from the original thread,
> when writing a query containing 'tsvector @@ tsquery', it's much more
> obvious to use "\do+ @@" to check if it's leakproof, rather than
> "\dAo+ gin".

I added it to \dAo+ since the initial motivation was that it enables to
check whether we can use an index scan for scanning a table which has RLS
policy when the condition contains a certain operator. However, as you
suggested, adding it to \do+ seems enough to know conditions using specified
operators can use indexes.

I'll fixed the patch to add leakproof info to \do+ results, but is it worth
leaving this info in \dAo+ results, too?

> Perhaps it would be useful to have this in \df+ output as well.

Agreed. I'll add the info to \df+, too.

> I notice that this patch spells "leakproof" with a hyphen. IMO
> leakproof should not have a hyphen -- at least, that's how I naturally
> spell it, and I think that's more common, and it matches the SQL
> syntax.

OK, I'll fix it to use "leakproof" without a hyphen.

> We haven't been consistent about that in the docs and code comments so
> far though, so I think we should make a decision, and then standardise
> on whatever people decide.

I am not a native English speaker, but if this is natural spelling in
English, I wonder we can replace all of them to leakproof without a hyphen.

Regards,
Yugo Nagata

--
Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey M. Borodin 2024-11-15 09:56:57 Re: Tweak some codes format in gist.c
Previous Message Tender Wang 2024-11-15 09:48:08 Tweak some codes format in gist.c