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.98.2) (envelope-from ) id 1xSRJi-00000001pxT-0jG0 for pgsql-bugs@arkaria.postgresql.org; Sun, 15 Nov 2026 03:54:10 +0000 Received: from localhost ([127.0.0.1]:57284 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xSRJh-0000000Ecvd-0dCc for pgsql-bugs@arkaria.postgresql.org; Sun, 15 Nov 2026 03:54:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]:58004) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xSRJg-0000000EcvV-3jIM for pgsql-bugs@lists.postgresql.org; Sun, 15 Nov 2026 03:54:08 +0000 Received: from mail-vs1-xe35.google.com ([2607:f8b0:4864:20::e35]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1xSRJf-0000000108H-2gUL for pgsql-bugs@lists.postgresql.org; Sun, 15 Nov 2026 03:54:07 +0000 Received: by mail-vs1-xe35.google.com with SMTP id ada2fe7eead31-7d2f4cc314eso2350231137.1 for ; Sat, 14 Nov 2026 19:54:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794714846; x=1795319646; 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=g7IY2IVTFsdAuPV/vZ04sweoNb7/tHaiHmv670wNxRA=; b=PAv22A5p7/HJ9ebATvbQDAFzuG8QNcalDs4MOXW17HAYJ27fDSkrlVad2hex7iu7Wu ZgS0BBCdYkQ3SPaZXvy1MsUm//5LCpltZhN6w0QobaGs+JV/JgskAMx3NYlTRs42ftDB sC+3nwkvDaHm218A9KFizIBvB7qzExnz2CiP20EyRMwq8Whtyqtn6aaS0XrspOrC0fcF y5K8rhA8b37thvc8oD0gkdKALS5hl0AsEcbvvyWuUjsqxRt8f8z5VR9Qtfzx0SQvWPy3 mARZCMOaRzyIcIDJWeEMs2BDu7AUs/+RYNsXhKT3HM+79Lx06ir0EQ6Q7/NvcP3fNED4 X72A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794714846; x=1795319646; 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=g7IY2IVTFsdAuPV/vZ04sweoNb7/tHaiHmv670wNxRA=; b=Sw8LjmMvSLerchy2mtkv34BYYvfhKrYUeQZk+mEQkHJkMDCzdKSDiv9tF96Q628I04 0jW0L/5NilvEV1nFYeI3USieVnl2+vRc/e5f5WwuDSWxNMpgxz4wY2Oj2UY4QL31AXK7 H7tuNJrq4VtqdXxjaLzRPnqYNH58cMT3PKjPFspLQ+z5gyr4d3SCweyQHOtfkPSi38A9 AiSfpjU4HRUGhxlUqT4CZDK/CIa5jqjb44f0ZhdpMfPXP5lt4oByryIMOsbIqj53Vstc 0zhgM1Q7vpS5/mHv81vLVUDF+COak2/wI6U4KB+pYBv5lHmu8xY0uTZ9PJ1MihsRSmqd 1Onw== X-Gm-Message-State: APuU4Z9lbVQQmb84T+jDYCicIjglXsFQuj7d6YSoo5DSEs9UFebJf788 bLDlPuCIcEKA5P+bu4+UG3zwvpLyRzc3r5D52ESnL7r8lNRwkLBHMy6s X-Gm-Gg: AYBFou2m6GuGqzRnFSkJN3EiVYtKOOXMKfUfnR9Oh/piIXxmPPmcByMXgLXfcluUptr SZ15Ea8S2l+xx1PhNGrwcBdO5D3DYe0J5wCqu6KmRAuba+UG1sdL3QDMavxYIQQQVM17YDxlnTi vo5RAd6YJn/ptN7GJEfjX5eBSX4KYq0G1p2ipl8ydcaf4+uGulCQxgoNF/nIcTwkt9W3nppdKMR ySHA56t8/mSte1qhF0u4D6LitMZ0R0Cqj7ox4NQt3xFQw79c9eTl+risgep5AxPiYrrAyS9sHCv 55iaJ5Y0lH1eD26BFIgVzDC9J6pxKHR0meiB6zt3Q3OFJv0RRsGNjgNCX1S2raCd5flPwEz11R/ bqeROB8Pm1KbqOQXI1WT7j7naB0kLxfiAhLnDy52knkST/cn8HOrsI+cqsvcGWctv86/w+e5I5g qKQnNFcW7SYXkqvFJLSSa2ZKCwKb8DpyXpG+FDBmbzj58d0Oq86E6k+aVsqnQTxhSthXA76Hnqo AYikQrlpPx1SiVAmfTjl2gSe9TuP5XrFbnzqNLVpSWtER6FIZusiXM0clTRBlSfWmskqif7FyuW /eX24smu/jLRfTsM48H8sMdC3FMYxiGvD0l7vHcB/2W4mCkSJbrtU7QKxHdI1C6XZN3aycPyR6k KgjAy+hspUAC6TZWeVcYDilygSvBSudOBeNeKjzgW2/cxttjclzXtjzgeevXx X-Received: by 2002:a05:6102:6e88:b0:7c2:7a0:ae28 with SMTP id ada2fe7eead31-7d64d874f06mr1772298137.30.1794714846432; Sat, 14 Nov 2026 19:54:06 -0800 (PST) Received: from NOTEBOOK-LAILA ([2804:14d:5c27:1387:a053:f15d:8c82:ed64]) by smtp.gmail.com with ESMTPSA id ada2fe7eead31-7d64c475cf4sm4401177137.5.2026.11.14.19.54.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Nov 2026 19:54:06 -0800 (PST) From: Joao Rito To: shihao zhong Cc: pgsql-bugs@lists.postgresql.org, Tom Lane , Peter Eisentraut , imchifan@163.com Subject: Re: BUG #19703: information_schema.usage_privileges omits a sequence owner's implicit USAGE privilege Date: Sun, 15 Nov 2026 00:53:59 -0300 Message-ID: <20261115035400.23692-1-joaovictor.rito@gmail.com> X-Mailer: git-send-email 2.53.0.windows.1 In-Reply-To: References: 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 Shihao, I tested v1 0001 and 0002 on current master (81b2179b492, built with cassert and tap tests). Both apply cleanly. On master, for a sequence with no explicit grants, has_sequence_privilege says the owner has USAGE but the view has no row for it. The same happens for the new owner after ALTER SEQUENCE ... OWNER TO. Sequences with an explicit GRANT already showed the owner row. A table owner shows up in table_privileges without any grant, so sequences were the odd one out. The reproducer from the report gives implicit_view_rows=0 on master. With the patches, the owner row appears for a sequence with no grants (is_grantable YES), for one with an explicit GRANT, for one with GRANT ... WITH GRANT OPTION, and for the new owner after ALTER OWNER TO. A role with no privileges sees no rows, and a sequence where the owner revoked its own USAGE has no owner row. For three roles and five sequences the view and has_sequence_privilege agree (0 mismatches, 2 before the patch). The reproducer now gives implicit_view_rows=1 and explicit_view_rows=1. make check passes (243 tests). With 0001 reverted and 0002 kept, privileges fails because the first new query returns 0 rows instead of 1, so the test does catch the bug. What I did not test: the isolation and tap suites, pgindent, the docs, other platforms (I ran one Linux build), upgrades from an existing cluster, and the back branches. I agree with Tom's vote against back-patching, so I checked only master. Small suggestions: the commit message of 0001 could mention that catversion is bumped or not, since Tom noted that information_schema changes have usually come with one, and the patch does not include one. The test could also cover a sequence whose owner is not the current user, but I have no objection to the change as it is. Regards, Joao Rito