pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: pgsql-committers@lists.postgresql.org, Amit Langote <amitlangote09@gmail.com>
Subject: Re: pgsql: Remove some dead code in selfuncs.c
Date: Thu, 19 Jan 2023 12:37:24 -0500
Message-ID: <4177931.1674149844@sss.pgh.pa.us> (raw)
In-Reply-To: <20230119171853.tdhnnzc6p4qum2hu@alvherre.pgsql>
References: <20230119171853.tdhnnzc6p4qum2hu@alvherre.pgsql>

Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> On 2023-Jan-19, Tom Lane wrote:
>> Ah, sorry, -ENOCAFFEINE.  It's talking about the access-as-user field,
>> not the relation's owner.  I agree that as querytrees are currently
>> built, this is probably a safe optimization.  But do we really want
>> to hard-wire such a subtle assumption to gain a microscopic speed
>> benefit?  It's not as though GetUserId() is expensive.

> Well, I didn't see it as an optimization but rather a removal of
> confusing code.  Given the current RTEPermissionInfo representation,
> it's just not possible for an "otherrel" to have a different
> access-as-user value than what "the relation mentioned in the query"
> has -- by construction, they share the same RTEPermissionInfo.

> If we wanted to decouple selfuncs.c from that knowledge, then what we
> should be doing is obtain the RTEPermissionInfo for the relation, and
> use the userid from there.  But the code I deleted wasn't doing that, it
> was just using the same 'onerel' all the time.  It's not difficult (or
> expensive) to do otherwise, but it seems somewhat pointless.

Hmm.  Point taken, and I agree that it's not worth adding complication
that wasn't there before to track this.  No further objection.

			regards, tom lane





view thread (5+ messages)

Message-ID: <4177931.1674149844@sss.pgh.pa.us>
Permalink:  ../4177931.1674149844@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4177931.1674149844@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, alvherre@alvh.no-ip.org, amitlangote09@gmail.com
  Subject: Re: pgsql: Remove some dead code in selfuncs.c
  In-Reply-To: <4177931.1674149844@sss.pgh.pa.us>
  References: <20230119171853.tdhnnzc6p4qum2hu@alvherre.pgsql> <4177931.1674149844@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox