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 1rkoTW-00FaYN-9o for pgsql-general@arkaria.postgresql.org; Thu, 14 Mar 2024 17:02:39 +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 1rkoSW-001Vxo-H1 for pgsql-general@arkaria.postgresql.org; Thu, 14 Mar 2024 17:01:37 +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.94.2) (envelope-from ) id 1rkoSU-001Vxf-SD for pgsql-general@lists.postgresql.org; Thu, 14 Mar 2024 17:01:36 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rkoSM-004Urb-6l for pgsql-general@lists.postgresql.org; Thu, 14 Mar 2024 17:01:33 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 50EB05C0046; Thu, 14 Mar 2024 13:01:25 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 14 Mar 2024 13:01:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1710435685; x=1710522085; bh=SX8Z9XusbXjSw/Wu0yCFMedwKSfzXXCudASvxjv9DYs=; b= RyWnUltnlxsE43cAKpryiy0AO9O7Uq6TplB+PBmTY98LOhC7xPelgHIpRRUZzwRq di2QfV3X76WjoOHiPSfCtZ/kf3XPoJ8I0CSSQdaptmDmvESKlamjdlNzQanKeDpd TapuCLIXy48/v5QbqaLRJX/SLLq0Lf7ltm3D7t8djCWu3z/69sJjnf+lROXtz5Ha kS369IMSq6ANgFNHyU+UHcMYdXgpSic/2pcP70JUMkNulkk0quk30pY4ucB45gWi 3RUz3w7ds60kQkihUd5xvJNXdq3wZzcwYNPitWPQBKVNzK5qBWkIGkF8gfF0ORNc luF8e9f08AckcvIniaThxw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1710435685; x= 1710522085; bh=SX8Z9XusbXjSw/Wu0yCFMedwKSfzXXCudASvxjv9DYs=; b=B 0bjkYk2v01XrzhxguogRKq9nro35eap0WSG5L2HkiS73n34V3UuD7atQikCfnA7H xNfxFrxZ9gy+P3Uklf9kZTUKLijr7JaTcB37I+b6DUz4Oka4Nv+aMR3H6Y/8OAQ9 zR7HkJBBGmxPH2v+r0no4VIjOAGg9VnevU0LGbwArg6S6XlpUzw3snxMSmL2NckJ SVMt+jytcbaKT2tBKu9AceuclZvsWh2X/YdBP9OZSdY38maL+XvTg3pwG76P4MAw 3hItm3cmEOJXFbQeGKj2Gl6asWfjXzH6J0piVHEjGPiIdPj8mQ+19oPJ208iYzb1 Ww9f5yQIBW5e2CU1cq/Ig== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrjeejgdelfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenog fuuhhsphgvtghtffhomhgrihhnucdlgeelmdenucfjughrpefkffggfgfuvfhfhfgjtgfg sehtkeertddtvdejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirg hnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepvdev hefhheegfedvkeeiffevgffgleduvdfhfeetgfffhedtffehfeeutdethfdvnecuffhomh grihhnpehisggsrdgtohdpphhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrh esrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 14 Mar 2024 13:01:24 -0400 (EDT) Message-ID: <18a61deb-c6d8-478b-9cba-0846ad20445e@aklaver.com> Date: Thu, 14 Mar 2024 10:01:23 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: select results on pg_class incomplete Content-Language: en-US To: Thiemo Kellner , pgsql-general@lists.postgresql.org References: <58dd037f-ffdf-488b-81bf-49ac908944d9@gelassene-pferde.biz> From: Adrian Klaver In-Reply-To: <58dd037f-ffdf-488b-81bf-49ac908944d9@gelassene-pferde.biz> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/14/24 09:41, Thiemo Kellner wrote: > Hi > > I am trying to access PostgreSQL meta data, possibly in a vane attempt > to get size data. > > I use DbVis with a connection as shown in https://ibb.co/2SDzhXt . I try > to get information on a regular table "umsaetze". When doing the DbVis > object I can see them - https://ibb.co/WxMnY2c . If I execute following > SQL query in DbVis's SQL Commander, the result set is empty - > https://ibb.co/GngdWLH . > > select * >   from PG_CLASS >  where RELNAME = 'umsaetze'; > > I noticed that the sessions producing the different results are not the > same - https://ibb.co/wdKcCFc , but seem to connect to different > databases. The "missing" table is indeed in the budget database. > > The connection user is, apart from being member of pg_monitor vanilla - > https://ibb.co/DGs6sQz and https://ibb.co/8xzHrvP . > > It seems, that in pg_class only is, with respect to custom databases, > listed what is in the database one connects to - https://ibb.co/dbbJVbJ. As listed on the tin: https://www.postgresql.org/docs/current/catalogs-overview.html "Most system catalogs are copied from the template database during database creation and are thereafter database-specific. A few catalogs are physically shared across all databases in a cluster; these are noted in the descriptions of the individual catalogs." pg_class is not one of the global tables. > > template1=> select count(*) >   from PG_CLASS >  where RELNAME = 'umsaetze'; >  count > ------- >      0 > (1 row) > > template1=> \q > > C:\Users\thiemo\AppData\Roaming\MOBAXT~1\home>psql -h hp-slimline-260 -p > 5436 -U monitor budget > psql (11.2, server 16.1 (Debian 16.1-1.pgdg110+1)) > WARNING: psql major version 11, server major version 16. >          Some psql features might not work. > SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, > bits: 256, compression: off) > Type "help" for help. > > budget=> select count(*) >   from PG_CLASS >  where RELNAME = 'umsaetze'; >  count > ------- >      2 > (1 row) > > budget=> \q > > > Is there a possibility to make the user monitor see all the objects of > the cluster? Background is that I was hoping to create a query to spit > out the size of tables in the cluster. > > Kind regards > > Thiemo > > -- Adrian Klaver adrian.klaver@aklaver.com