pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Drouvot, Bertrand <bertranddrouvot.pg@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
To: Jacob Champion <jchampion@timescale.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Joe Conway <mail@joeconway.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: SYSTEM_USER reserved word implementation
Date: Wed, 28 Sep 2022 12:58:48 +0200
Message-ID: <38fdbdab-8aa5-8408-916f-cab681aa0d67@gmail.com> (raw)
In-Reply-To: <YzO/PawKtWSvLGFC@paquier.xyz>
References: <YwWooBzPlfzncJea@paquier.xyz>
	<1da0e60c-bd85-9f2d-2039-103055338b00@amazon.com>
	<40b4e4d0-d034-ea19-3ec3-1557f498770f@amazon.com>
	<YwgboqQUV1+Y/k6z@paquier.xyz>
	<Yxha7/s9z8qk/R1e@paquier.xyz>
	<9dae37cb-abe0-a773-da74-3e2b62279d4c@amazon.com>
	<dc0e1444-9520-2841-5d9e-df054a1aae05@timescale.com>
	<YxlCjBQ1LRhEY7bx@paquier.xyz>
	<e7972fb0-2a29-45d6-b036-52f96b93afe9@gmail.com>
	<32514125-2688-00c3-0210-44a467dd0470@timescale.com>
	<YzO/PawKtWSvLGFC@paquier.xyz>

Hi,

On 9/28/22 5:28 AM, Michael Paquier wrote:
> On Tue, Sep 27, 2022 at 03:38:49PM -0700, Jacob Champion wrote:
>> On 9/26/22 06:29, Drouvot, Bertrand wrote:
>> Since there are only internal clients to the API, I'd argue this makes
>> more sense as an Assert(authn_id != NULL), but I don't think it's a
>> dealbreaker.
> 
> Using an assert() looks like a good idea from here.  If this is called
> with a NULL authn, this could reflect a problem in the authentication
> logic.
> 

Agree, thanks for pointing out.

>>> As far the assertion failure mentioned by Michael when moving the
>>> SVFOP_SYSTEM_USER from NAMEOID to TEXTOID: V4 is assuming that it is
>>> safe to force the collation to C_COLLATION_OID for SQLValueFunction
>>> having a TEXT type, but I would be happy to also hear your thoughts
>>> about it.
>>
>> Unfortunately I don't have much to add here; I don't know enough about
>> the underlying problems.
> 
> I have been looking at that, and after putting my hands on that this
> comes down to the facility introduced in 40c24bf.  So, I think that
> we'd better use COERCE_SQL_SYNTAX so as there is no need to worry
> about the shortcuts this patch is trying to use with the collation
> setup.

Nice!

>  And there are a few tests for get_func_sql_syntax() in
> create_view.sql.  Note that this makes the patch slightly shorter, and
> simpler.
>

Agree that it does look simpler that way and that making use of 
COERCE_SQL_SYNTAX does looks like a better approach. Nice catch!


> The docs still mentioned "name", and not "text".
> 

Oups, thanks for pointing out.

I had a look at v5 and it does look good to me.

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com





view thread (42+ messages)  latest in thread

Message-ID: <38fdbdab-8aa5-8408-916f-cab681aa0d67@gmail.com>
Permalink:  ../38fdbdab-8aa5-8408-916f-cab681aa0d67@gmail.com/
Also on:    postgresql.org/message-id/38fdbdab-8aa5-8408-916f-cab681aa0d67@gmail.com

 · 

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-hackers@postgresql.org
  Cc: bertranddrouvot.pg@gmail.com, michael@paquier.xyz, jchampion@timescale.com, alvherre@alvh.no-ip.org, tgl@sss.pgh.pa.us, mail@joeconway.com
  Subject: Re: SYSTEM_USER reserved word implementation
  In-Reply-To: <38fdbdab-8aa5-8408-916f-cab681aa0d67@gmail.com>
  References: <YwWooBzPlfzncJea@paquier.xyz> <1da0e60c-bd85-9f2d-2039-103055338b00@amazon.com> <40b4e4d0-d034-ea19-3ec3-1557f498770f@amazon.com> <YwgboqQUV1+Y/k6z@paquier.xyz> <Yxha7/s9z8qk/R1e@paquier.xyz> <9dae37cb-abe0-a773-da74-3e2b62279d4c@amazon.com> <dc0e1444-9520-2841-5d9e-df054a1aae05@timescale.com> <YxlCjBQ1LRhEY7bx@paquier.xyz> <e7972fb0-2a29-45d6-b036-52f96b93afe9@gmail.com> <32514125-2688-00c3-0210-44a467dd0470@timescale.com> <YzO/PawKtWSvLGFC@paquier.xyz> <38fdbdab-8aa5-8408-916f-cab681aa0d67@gmail.com>

* 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