Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozQ1H-00037X-7f for pgsql-general@arkaria.postgresql.org; Sun, 27 Nov 2022 22:21:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ozQ1F-0001P9-L3 for pgsql-general@arkaria.postgresql.org; Sun, 27 Nov 2022 22:21:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozQ1F-0001P0-Ah for pgsql-general@lists.postgresql.org; Sun, 27 Nov 2022 22:21:01 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozQ1D-00085e-4v for pgsql-general@lists.postgresql.org; Sun, 27 Nov 2022 22:21:00 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 8EBDF320029B; Sun, 27 Nov 2022 17:20:57 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 27 Nov 2022 17:20:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1669587657; x= 1669674057; bh=1icepQiQSXOgaFrMYAGBeDGr+ioHIuFCs7JnbIKwfNE=; b=M DYMR74hLfl29iShZzeFYUdLeBD5PvoBrZAg4avpBgqgvJWLfUXgoB+urZ4m3QU/7 b/aLTA/3X4y2fDputyczMnqHxxtnDGzvUSi0oC0joNQcI+1RvQyyPsDoL7Kea/yl fVB0i99irHvtZDOOAe7h34QUA8GUGvGxPUlbGSre/c3t1FosIJEKgVjvIhzljXyq Q5iBfi8eDb8ZScLC0wyexCu3hQ+SO4cxdbs/hE+uU4LaKr7ZHaPyTFP0fXIEPOgw H0mheIz2gWtJesQXkhLQKkjE09Ckp/UKAetXyjXSLEcv9wuMQ5cPOTCuyUXktlu7 AyZC3ur7ReySkZqP9vZ0A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1669587657; x= 1669674057; bh=1icepQiQSXOgaFrMYAGBeDGr+ioHIuFCs7JnbIKwfNE=; b=G l9y2vqOIMXx/thsSbojVfqzwSBq0ilTf9mNtlpQZgoI1kAY8xyj2s0ZuJ/C/CKZ2 Twzz6h7K6F8Af5wZp51z/Vp53R6Ma7W/of+1aIo2om2ZYlRTUX6XY+4HAQcdfZxV 8NznxqbJ3O327PggAYGa1twyIMfviNdHBe0NGlhO7vaubiVluA+QF09o8h3e2jbf PFRgf9F0fMDfwK/t5j+Ijek8mlJTcy4uPt7EdwZQCkxVV6jkB9fDKjjhDvqAicu1 XcwI6KBo6l6IC0V8Xc3WyvTg05OhqpwbtU+3yKgFpKtBPPZrjY2/mcNuy5hvaZWc 0Z9L/A/dTAVMsGjo6QATg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrjedtgdduieduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhepjeegtdfhuefhtefgffdvheduleetgeejudevffek teegjeeiheeuudellefgffffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 27 Nov 2022 17:20:56 -0500 (EST) Message-ID: <6c498970-0286-e3bd-748f-c1ad48dadc86@aklaver.com> Date: Sun, 27 Nov 2022 14:20:55 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: Get table catalog from pg_indexes Content-Language: en-US To: Igor Korot , "David G. Johnston" Cc: Erik Wienhold , "pgsql-generallists.postgresql.org" References: <1113989301.734580.1669571975787@office.mailbox.org> From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 11/27/22 14:11, Igor Korot wrote: > David, > > On Sun, Nov 27, 2022 at 12:55 PM David G. Johnston > wrote: >> >> On Sun, Nov 27, 2022 at 11:42 AM Igor Korot wrote: >>> >>> >>> It doesn't say anything about "current" DB - only the DB. >> >> >> Yes, but you must be connected to some database in order to execute this command: "the database" refers to this database you are connected to. > > Yes, I am and I get that. > >> >> The catalogs are not information_schema. >> >>> >>> However, I think I can try "SELECT 1 FROM .pg_indexes...". >>> Will this work? >>> >> >> What is that even supposed to mean? It also seems simple enough to just do that asking "will this work" is a waste of time. Just try it. > > Apparently it looks like this query fails to execute. > I am connected to the "draft" database and running > > SELECT 1 FROM draft.pg_indexes; > > gives: > > [quote] > ERROR:schema "draft" does not exist > [/quote] Because the layout is catalog.schema.table so: SELECT 1 FROM draft.pg_catalog.pg_indexes; Just because this works don't leap to assumption that: .pg_catalog.pg_indexes will work. This only works with the current database name. > > Thank you/ > >> >> David J. > > -- Adrian Klaver adrian.klaver@aklaver.com