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 1wkjYe-000qTS-2c for pgsql-bugs@arkaria.postgresql.org; Fri, 17 Jul 2026 14:28:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wkjYd-000PGC-0k for pgsql-bugs@arkaria.postgresql.org; Fri, 17 Jul 2026 14:28:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wkjYc-000PG4-38 for pgsql-bugs@lists.postgresql.org; Fri, 17 Jul 2026 14:28:54 +0000 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wkjYa-00000000gRA-0GRS for pgsql-bugs@lists.postgresql.org; Fri, 17 Jul 2026 14:28:53 +0000 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-84862b0d5aeso8738982b3a.2 for ; Fri, 17 Jul 2026 07:28:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784298531; x=1784903331; darn=lists.postgresql.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=lkMB6O34qLrBq9f1reD0EjhoyoyMozlia4kSeyhfKCk=; b=hS8KuDM98yYNkzAorwnR4sVFdJsAHN6GHHAjRj6nd68TRQFOYslIREfQ/GZRdV1rYE wnkrCv0oBPI23FBd7TVp8yWwNYEk7GKMnrYzMiIDvXu8qD7f/szUvRL+xMdI5AJXKbB6 h4NvuuBhmZes+jXDAHNSw6EUqF3ZD7zmvtKnBJhTEVXvskZuG8XwMOhIBqudMZulgPD2 VWn1F6UUNrjxrH9VlKlb7L0luN3jmgyzi6VACRobdb9HirnV1j5IsToZ3OAh5jmO8I50 eP6/sWc6hFRZJGlVXSypToDCnnoDLNzG71GdMmNsuDnhizZKShC4iSBGLMtGe5x8RErY 6ekw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784298531; x=1784903331; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=lkMB6O34qLrBq9f1reD0EjhoyoyMozlia4kSeyhfKCk=; b=Y/wG7QDhQ8hihrXgpzvfmyx4nag6DUWqvPxDKPNLpblPuysR+WTjfQbwSgA1ZlFg+Z MgjMvS/HDFjuBcIzcx0Ta4M3DNFeg4uXPghKOgHUyOkK5RLM9tJi7WpJom0l0JCsgqT0 k6XUGvGzi9wGV16/r+YqqXin5y/7yQJVpOZ6kK2em8FFOPUiXUcXaM+XWzbhcD0rEmma 9PhNf041oygTg6W+czZQkkZwaBfBWtZhyePslMkv+vz85FsSEfpzbeFyYdHKOGvNwNFW FF7UD75H1omEO70MeJ8EcdNiQbKhOI2SUZV1DxWIX9FELApnQZrN7juy7UmAnSqeHdDS uDBA== X-Gm-Message-State: AOJu0Yy1u1xdkxyHjGkewz4BbGVAmaamo7NyKY3N66Ze8CVQDH4jZEag FR7qFdUR2PfMXXeKlo90BBllYk7PwvNuRn2gHgx7qVO8baTfFOmLHZI3EfvS6GBhOyaApw== X-Gm-Gg: AfdE7clDZ/VMvNqyE2CRZLAYYSNeoFNwt8lbn5a7ioy7cl0SIi0ZmvUR9x/2XZL96kk C7dlrwl3x4LYONpo40NtS/c9AQVujGE3+Cg5j9OoUa7pegxUnsc/j21itTiQ4oFZyoXYh/rmL5A o/wgUDPvh0e9m+gS4HBw6Ylq4SNO1+U1sgSik2zb76nr5ElBYETz1fJTW8AXrAOcTBvadkB9zwV WK2Kf+j5WN37rQd0izJTXk7Fk6EJ+Dh8q44jkTmUSDGM9I+6dpfqHjoH4hn1+WoAJAFeHhvHTen qSNmKvXTqI8L3bnqYEVskLIB83P0kViGWyG72sYP7GdeYjvBD15MRaS4JiCIEEqi3Rk7hHNAYOw 3Ltdy5ofNXluZqZ7FIZn4wIdkAOPs/elXrrnBsN0GgfWHlUS4SP69avv9Hjmsv9dMOmqj/ORg9o EOQGZQpKEFsbSUYmolpSoiI54Od6I= X-Received: by 2002:a05:6a21:1519:b0:3bf:6c08:4ebb with SMTP id adf61e73a8af0-3c3ad8b2a79mr3380463637.48.1784298531236; Fri, 17 Jul 2026 07:28:51 -0700 (PDT) Received: from localhost.localdomain ([211.41.105.17]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cb519de3437sm889500a12.28.2026.07.17.07.28.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 17 Jul 2026 07:28:50 -0700 (PDT) From: Paul Kim To: pgsql-bugs@lists.postgresql.org, vismay.t@gmail.com Cc: reshkekirill@gmail.com, Paul Kim Subject: Re: BUG #19523: psql tab-completion shadows pg_db_role_setting Date: Fri, 17 Jul 2026 23:28:47 +0900 Message-ID: <20260717142847.89731-1-mok03127@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: References: <19523-424457118202f570@postgresql.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Vismay, I had a look at the v1 patch, looks good to me. Query_for_list_of_database_vars really is the only completion query still referencing catalogs unqualified -- split_part()/unnest() right next to it are already pg_catalog-qualified, and the sibling queries (Query_for_list_of_databases, _tablespaces, ...) all qualify theirs too, so this just brings it in line. I reproduced it on master with a shadowing table: CREATE SCHEMA s; CREATE TABLE s.pg_db_role_setting (setdatabase oid, setrole oid, setconfig text[]); INSERT INTO s.pg_db_role_setting SELECT oid, 0, ARRAY['evil_var=x'] FROM pg_catalog.pg_database WHERE datname = 'postgres'; SET search_path = s, pg_catalog; Before the patch the query hands back 'evil_var'; after qualifying both catalogs it returns nothing, and a real ALTER DATABASE ... SET still shows up fine. Applies and builds cleanly here. On back-patching: the macro came in with v18 (9df8727c50), it's in REL_18_STABLE and master but not REL_17, so v18 + master matches what you said. Agreed on leaving out a test -- the completion queries aren't covered by TAP anyway. One small nit, and it's not really about the code: since we've settled that this is more of a consistency/robustness thing than a security issue, the commit message's "feeds arbitrary values" wording could probably be toned down, but that's the committer's call. Looks ready for committer to me. Regards, Paul