Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1odUnY-0003X1-KW for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Sep 2022 11:00:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1odUnW-0000fk-NA for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Sep 2022 11:00:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1odUnW-0000fb-Bq for pgsql-hackers@lists.postgresql.org; Wed, 28 Sep 2022 11:00:14 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1odUnO-0000bU-Uh for pgsql-hackers@lists.postgresql.org; Wed, 28 Sep 2022 11:00:13 +0000 Received: by mail-wr1-x434.google.com with SMTP id r7so19224948wrm.2 for ; Wed, 28 Sep 2022 04:00:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=x9RN+pKZuq7Q05N0rdqf/YqoPwIVLz3P26f7eBqAi34=; b=Gd3wTGN+KkMnR9pIG1PScMh3ra/ekWZPME7YG8OtFHyO/IXh3tf8hUnQF2juAhMq9j UU0VLGscO3WKAMgD/R0Y6R5FbySAHi7TX5Dsrs6ZLRMb+o2pU5nZzrDwCWeTOEd5CUG3 Ka1pGqfi+a6wt87SRgP+z66bL/VYZXhD0gSyZ0URTa4U83ikl08lFIcj2U7+u3NPMsos CDJB/ncOtO50g3AK984HHmm4c0G+yzVVMvuFhEVvFCuqnxYpwGd46l/XuHN8NFQU9t2b tRP01brBh24aHJJA63BXDXRRam5CxUDt/zsrE1U6UZxb21/NxW1VzQ6AhEUALahJNsdW Zf5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=x9RN+pKZuq7Q05N0rdqf/YqoPwIVLz3P26f7eBqAi34=; b=I8L6owre6jkMBBAmAf2iOzTlX7he9c8ZrsAYkcZO37pQu6jzRnrjIH16QPRk/+2zie R4ESULFtQlozTRMSqc1lPcZCdzVS5zC5d23cPLx+lmofi8hGYgNsr5IaGnAKveJJPUA/ 2WhGDytwpHATBGCgouB15D3SiCKUonQvin8ThTA6epWLqvcaYCNbbkO+6jQfMr8Z1v53 V7EKTuqockoowY4+IzhOuObDbDgAZJ62GBHQuY8HSmbugryh8JhixU8FMSzZPII6OCDJ c9Cv+GjkR+9rNaoTDL0EkhRKrl5AWMhgZna5u6c3s5uWNEbYBx9+UCw6Zo8wlNb/uufq 45Rw== X-Gm-Message-State: ACrzQf2N/SBFBo+t81xJ5yaR0RlhOXZtNJgOyVKhxlAPqz83s9D+zsMF Bp+4xU+E0+DTNjzVvsTyac8= X-Google-Smtp-Source: AMsMyM6NY0SYTocNdReqb09VR70LbYBeUkw+oTBNzK/JfPIiqa/H/5r3qx1Pltw0SoWLgEFS8wYp9Q== X-Received: by 2002:a05:6000:1ace:b0:22b:113a:461 with SMTP id i14-20020a0560001ace00b0022b113a0461mr19389332wry.545.1664362805696; Wed, 28 Sep 2022 04:00:05 -0700 (PDT) Received: from [192.168.31.157] ([54.239.6.188]) by smtp.gmail.com with ESMTPSA id c3-20020a5d63c3000000b00228da396f9dsm4052040wrw.84.2022.09.28.04.00.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Sep 2022 04:00:05 -0700 (PDT) Message-ID: <38fdbdab-8aa5-8408-916f-cab681aa0d67@gmail.com> Date: Wed, 28 Sep 2022 12:58:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: SYSTEM_USER reserved word implementation Content-Language: en-US To: Michael Paquier , Jacob Champion Cc: Alvaro Herrera , Tom Lane , Joe Conway , PostgreSQL Hackers References: <1da0e60c-bd85-9f2d-2039-103055338b00@amazon.com> <40b4e4d0-d034-ea19-3ec3-1557f498770f@amazon.com> <9dae37cb-abe0-a773-da74-3e2b62279d4c@amazon.com> <32514125-2688-00c3-0210-44a467dd0470@timescale.com> From: "Drouvot, Bertrand" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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