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 1tMsQw-0077Wh-Uz for pgsql-general@arkaria.postgresql.org; Sun, 15 Dec 2024 17:29:34 +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 1tMsQt-00FLbB-KX for pgsql-general@arkaria.postgresql.org; Sun, 15 Dec 2024 17:29:32 +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 1tMsQt-00FLb3-9e for pgsql-general@lists.postgresql.org; Sun, 15 Dec 2024 17:29:32 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tMsQs-0030Lq-2t for pgsql-general@postgresql.org; Sun, 15 Dec 2024 17:29:31 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 4BFHTQfP1627467; Sun, 15 Dec 2024 12:29:26 -0500 From: Tom Lane To: Pavel Stehule cc: Ron Johnson , pgsql-general Subject: Re: Request for new column in pg_namespace In-reply-to: References: Comments: In-reply-to Pavel Stehule message dated "Sun, 15 Dec 2024 18:15:57 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1627465.1734283766.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Sun, 15 Dec 2024 12:29:26 -0500 Message-ID: <1627466.1734283766@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Pavel Stehule writes: > ne 15. 12. 2024 v 17:59 odesílatel Ron Johnson > napsal: >> A new boolean column named "indissystem" that's true only for system >> relations would make *many* maintenance queries cleaner, since they'd >> look like: >> select ... > oid of all system objects is less then 0x4000 That wouldn't help for excluding temp schemas, and it's not totally trustworthy for information_schema either. But I think the real problem with Ron's proposal is that it presumes there is a one-size-fits-all notion of "system schema". As a counterexample, for some maintenance activities (such as vacuuming) you might wish to process pg_catalog. What I'd suggest as an improvement that could be implemented immediately is to wrap the checks in a user-defined function like "is_system_schema(nspname name)". regards, tom lane