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.96) (envelope-from ) id 1wXCF2-0037Mg-2U for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Jun 2026 06:16:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wXCF1-009UCj-1f for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Jun 2026 06:16:43 +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.96) (envelope-from ) id 1wXCF1-009UCb-0n for pgsql-hackers@lists.postgresql.org; Wed, 10 Jun 2026 06:16:43 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wXCEy-00000002HYk-2YLf for pgsql-hackers@lists.postgresql.org; Wed, 10 Jun 2026 06:16:42 +0000 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-45ef616daf6so5816661f8f.3 for ; Tue, 09 Jun 2026 23:16:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781072199; x=1781676999; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=BCx8VdbLPl1EJvjWoPWJdC18njPRQLVA07CN6yC3HcA=; b=sqM6gdIqQMCiXJYqx0hftgVgkn0iFnlPja94ocqH4xWmYx8hghdx7PFr0OieAVIQrz V6pvXg8G/wnqyofJrkYovzfdxzdeyTrJDThu71QeFsutul8dmjJc/qo2Qg0SY/fpZCGD nkRXqJOVaIk5qQTvKs3F66+pBjn6aehPMH5BY7WRKaU/TiNjIs+XyYItWaigZO5Iw3YO ORHrhvNvbZI2XMeU6thFsXklKz8XDI2rovJeQeXqjTxM4jL4O+zoPezuWDSsLawogLcQ bQEDJ8aF6hjIpzhXhB6Nuy/pPzlQWTnduN7ld3VblRdOs6HxHt7D5SJeU8jli/MOcSI0 tCpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781072199; x=1781676999; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BCx8VdbLPl1EJvjWoPWJdC18njPRQLVA07CN6yC3HcA=; b=aYFLQndVzYdCCbWrD7EkbOyX6FEP7uMSXZaDjo1dBF6hSKbgefZJLQCf+/VxgBtkbO z0YhoFLsPtDIN1ofdwK080Sqw4vdBvIZ5qs7TqdxeWOrrwh3dP+K4tY03UHAXj19S3MB uOhmih5/QsSvFUusIgabSlpM+Lo2CEeIqRfkgn/ZWC/pL0QQMd0kCJk+CtK4uRp3eXlM DAaFrzGm+/Fek0Ol8oLWBFaKoLNtycpyyM8qIdaE2qxV31JVf277bymwaK7lK9ZdqJup 4x1w9fJqn+Yu24FhkTcHvH5NCbG9WJK83vW3Ywr+d8n4pnSPqGNwetb2BHYpi6IeZhwn JStw== X-Forwarded-Encrypted: i=1; AFNElJ9P6T1zAxcSu1BxjkiopLIurSCwRYp3EMOZPggxKIs9tPrbiX1wyqzpdwxmYLyvPIVlf0pIvCluZ6iN9d+D@lists.postgresql.org X-Gm-Message-State: AOJu0YzDsbJ7u+cmZirjbxXLEfE2Oh1AZUuyJMzITZVWDLVYewMAtz4O B86Zrx8Nb7GZ3tVSvoSoKX0AiOmBkYr0LPw5+KkJstgLGSBHsNM8GQdi X-Gm-Gg: Acq92OHp/vxz6tsq6k4SRK4MwedE7ruEK/eAEaV8W1NClcbmVD49ofeUh7xomp12qgX fxmZq2M1DmnmrTxZ0X/0oGvXT/Q5DjQfcfOI2BGJe+5410KU/VlKePH7JE9aqNsBm5ao+FO8DgU 3cnmZtLfODceuE3REbfDwzN2h4QK6YC/SVOWYrOw2c4yzsI95PLnqm/707YKVV/hJVUGv4BayQe wr1T5aBn2+HbrnU2lqPyWk0gjXghtqaHWNz0BQutceLSaijWWCxHbC/i5o0YRHlfpsPa5zHXslA Qlj5nCPgpttDY84yPpZrCkazucCv0eFznAFasBSPvKQCX/9oO8HlEiiPK2KfKBP0pJjUkL7056t 8kNuY8X2mP8Ng/gEPgx7JWIscYuj6FaNApW1ukS04ojKn7c1fkjF0ACSPXBkIFhLJrO//S8jrA9 Aslbbk1m/BVgHJZznxOevSCebMZg6rCZijR8Miphc5WKR65v4RlFjzPhHt88S5Tj4y1BG18h2nj h8qVcLMTxwr12d6mQK0aA== X-Received: by 2002:a05:6000:25c4:b0:460:18cc:dcfe with SMTP id ffacd0b85a97d-46030621869mr38907334f8f.34.1781072198892; Tue, 09 Jun 2026 23:16:38 -0700 (PDT) Received: from bdtpg (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4602cda3651sm57244195f8f.32.2026.06.09.23.16.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 23:16:38 -0700 (PDT) Date: Wed, 10 Jun 2026 06:16:36 +0000 From: Bertrand Drouvot To: Tom Lane Cc: Michael Paquier , Chao Li , Postgres hackers , Fujii Masao , Peter Eisentraut , Jeff Davis , Ashutosh Bapat , Amit Kapila Subject: Re: Fix unqualified catalog references in psql describe queries Message-ID: References: <1236173.1781057568@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1236173.1781057568@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Tue, Jun 09, 2026 at 10:12:48PM -0400, Tom Lane wrote: > Michael Paquier writes: > > On Tue, Jun 09, 2026 at 09:08:50AM +0000, Bertrand Drouvot wrote: > >> Now I wonder if we shoud not "protect" the operators too. They could also > >> lead to wrong results (if not worst). > > > Kind of true. Still we have been pretty lax about the operators as > > they also lead to less readable queries. > > We disclaimed security against odd search_paths for these queries long ago, > precisely because wrapping every operator in PG_OPERATOR(pg_catalog.*) > would be far too tedious and destructive of readability --- not to > mention that there are some syntaxes such as IN that don't even offer > the option to do that. I do agree that doing so would "destroy" the readability. I did not look in detail, but what about forcing ALWAYS_SECURE_SEARCH_PATH_SQL before the queries and restore the search_path once the query is done? (that way that would not impact the readability) Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com