Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uLWtK-00B6sN-Qz for pgsql-hackers@arkaria.postgresql.org; Sun, 01 Jun 2025 00:49:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uLWtH-00GzfD-5K for pgsql-hackers@arkaria.postgresql.org; Sun, 01 Jun 2025 00:49:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uLWtG-00Gzf5-LA for pgsql-hackers@lists.postgresql.org; Sun, 01 Jun 2025 00:49:30 +0000 Received: from 003.mia.mailroute.net ([199.89.3.6]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uLWtC-0017pe-1I for pgsql-hackers@postgresql.org; Sun, 01 Jun 2025 00:49:30 +0000 Received: from localhost (localhost [127.0.0.1]) by 003.mia.mailroute.net (Postfix) with ESMTP id 4b8yzS1FBkzlvl4g; Sun, 1 Jun 2025 00:49:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :mime-version:user-agent:date:date:message-id:from:from :references:subject:subject:received:received; s=mr01; t= 1748738963; x=1751330964; bh=QVO+L3UDSMnKEHh4mcoyyjc8KkAXC2YDr4m OSho7t4o=; b=TPbBarfhsaOJbQsiPi3olh1rDofhFHoVcEUKrgSowrwAPkbt2vf D0RTf6Z4cNeppCOSOnflBeFfGJzDeC4O4ndLvFjC8XADN2gE3fqKceqsB4nyoRWC NLVJDODW8F9M/lOJ8Z07XJMWyg2TZPGmWE7yr5vm6z4YhZHPqRFMxVgX5srE1Tn4 qxPwl8yiS1gBI9aTJ/6A5ybyMBsCoHtFVgomDcG2hWRk3OPQGaSCrsba/BcXcQ99 V4grwapNpIRNh980u1f4qD1eRavOSRtSfA8T0uKqo8biXq2+ziqZ81PdBtdtMjEM a+BnNoIeTUULwYlw0HaqIWqjB5KPKofwDgA== X-Virus-Scanned: by MailRoute Received: from 003.mia.mailroute.net ([127.0.0.1]) by localhost (003.mia [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id irFXth01yqbZ; Sun, 1 Jun 2025 00:49:23 +0000 (UTC) Received: from [73.103.120.3] (c-73-103-120-3.hsd1.in.comcast.net [73.103.120.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: jcflack@acm.org) by 003.mia.mailroute.net (Postfix) with ESMTPSA id 4b8yzQ2Zgmzlvl4Z; Sun, 1 Jun 2025 00:49:21 +0000 (UTC) Subject: Re: tighten generic_option_name, or store more carefully in catalog? To: Tom Lane References: <6830EB30.8090904@acm.org> <3020890.1748735715@sss.pgh.pa.us> Cc: PostgreSQL Hackers From: Chapman Flack X-Enigmail-Draft-Status: N1110 Message-ID: <683BA390.7000903@acm.org> Date: Sat, 31 May 2025 20:49:20 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <3020890.1748735715@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 05/31/25 19:55, Tom Lane wrote: > Chapman Flack writes: >> SQL rules would also make its case-sensitivity dependent on faithfully >> recovering whether it was delimited or not. > > I'm not following that part? It's that ISO rule that identifiers match case-insensitively if they weren't quoted, case-sensitively if they were. We don't explicitly store in catalogs whether quoting was used. Clearly it must have been, if the stored form has any non-lowercased letter in it, or any non-regular-identifier character. But if we just have foo in the catalog, it could have been either of foo or "foo". Which makes me a little sad because if I provide a way for someone to, say, check FDW options in Java, and they spell an option FOO in their code, I would ideally like to report OPTIONS (foo 'bar') as matching and OPTIONS("foo" 'bar') as not matching. But the information I could use to do that just isn't there.[0] Since writing that email, I've stumbled onto more things that seem a bit bizarre about the FDW extension API, and written about them here -> [1]. (I can't make an internal link anchor there that works, but it's a short scroll down to the "Notes on the validator function" heading.) I was surprised that FDW validators weren't designed the same way as PL validators (just provisionally put the object in the catalog, then say "validate this oid", and if the validator throws an error the object goes away). That would have avoided all the funky shortcomings I just wrote about. Obviously it's too late to change the existing FDW validator API and break everything that uses it. But I wonder if it would be completely crazy to just offer a new one: say if your CREATE FOREIGN DATA WRAPPER names a validator function with signature (oid classid, oid objid) then that's also an acceptable validator function and will be called with classid, objid of the provisionally-entered {wrapper,server,table,attribute, user mapping} to be validated. Regards, -Chap [0] It's possible I'm hyperattentive to that sort of thing because IIRC there was an old PL/Java CVE where we wouldn't let a non-superuser change the Java class path on the public schema, but if she spelled it puBlIc it was ok. (The function got the schema name as text.) [1] https://github.com/tada/pljava/issues/430#issuecomment-2921101005