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 1ozPFe-00012N-RV for pgsql-general@arkaria.postgresql.org; Sun, 27 Nov 2022 21:31:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ozPFd-0006ta-O3 for pgsql-general@arkaria.postgresql.org; Sun, 27 Nov 2022 21:31:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ozPFd-0006tR-Cq for pgsql-general@lists.postgresql.org; Sun, 27 Nov 2022 21:31:49 +0000 Received: from mail-qt1-x836.google.com ([2607:f8b0:4864:20::836]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ozPFa-0004xK-Uu for pgsql-general@lists.postgresql.org; Sun, 27 Nov 2022 21:31:49 +0000 Received: by mail-qt1-x836.google.com with SMTP id c15so5599905qtw.8 for ; Sun, 27 Nov 2022 13:31:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=jdHzPCBwXZ7YTLcTFyxVzTtJ2V95xGe5P3e1C6s1Uns=; b=YzYf4G9p7zeElc2j6jbGuJS7xHqKwmt/SKkF3eUqhJwTPsCILOAoexyPhBfYfPEbG7 0Jla7A+qeEo3jvPvgZc1esdsn/gr1nfjUGwt81f2aisKzKXMFl+egSwHEnI3o6mc55IR M0e0LdAZQHV5MZpUBXIfsBTfxU28UQFytaSjgwMuUo0Vk3iYNVKLARlzRrttEsAWsS2r 7dMWMiXOJVxn2tW2fLT6K/0EvQu6P+KOj5dR0dCYTfikptkhTkbDx/1pwsPOMP8IZO8z lIE8d3ZMknLq8HpzEaS2iZVgUYdgXEdRyYL8xVaSTthYlYtwaN1p7riKb9y+5iLQcYCR HEgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:from:references:to:content-language:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=jdHzPCBwXZ7YTLcTFyxVzTtJ2V95xGe5P3e1C6s1Uns=; b=NRSQXonuzyO8wZXPnpZPYVzvD6yN3qurxp6I+NL0A/uma/WEyIqp58OofqSChLkHEz yQSRIUTRNIo2XUPF32O7q07ZBwKSd/C89lMBmv9dGf8j2ZZb3ACUQ7fpDLuEm45fOaST NIXIoEGs9AARyZvWoRiet5hGJmcSaOBCOQ8t5DpaGqhXMNzz1JyYNgStPbYWMMu0KSTq up05/Ceflk9LFa5dinCvRmpHGTdXSrosFlyo7xLVTuyAjjVAHzqVlu8zAU57J320zG8U 1PR0GwhQkR9IUziM8rVCO7xvEC9sJbtjY2X3vEcqCx71cxL2WNgnZFos+ETpNfnQm5si Ca1w== X-Gm-Message-State: ANoB5pnvQWiWRhe5FyGR2nA98CcLg8ULvQWig6D49rVR1ODyJ7S4Z3D/ K0Ixb3/xk5b7Ne0KHEEX8I6I0WQ7Otw= X-Google-Smtp-Source: AA0mqf6yJT4uwpjMB0hnzC0OyW6B3hMU54VIwakT+h6fyOcqbDv/gfLZeFF027RhucnwzDpjs/88aQ== X-Received: by 2002:a05:622a:4ac9:b0:3a5:ae7:9ada with SMTP id fx9-20020a05622a4ac900b003a50ae79adamr29769920qtb.191.1669584705099; Sun, 27 Nov 2022 13:31:45 -0800 (PST) Received: from ?IPV6:2600:1700:bd2c:b810::43? ([2600:1700:bd2c:b810::43]) by smtp.googlemail.com with ESMTPSA id bv14-20020a05622a0a0e00b0039c37a7914csm5907792qtb.23.2022.11.27.13.31.44 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Nov 2022 13:31:44 -0800 (PST) Content-Type: multipart/alternative; boundary="------------DjetLsOTuaJoRrAbcEwJiFME" Message-ID: <467d46cc-553f-0014-5a09-6ddf7ccf4fdb@gmail.com> Date: Sun, 27 Nov 2022 15:31:44 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: Get table catalog from pg_indexes Content-Language: en-US To: pgsql-general@lists.postgresql.org References: From: Ron In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------DjetLsOTuaJoRrAbcEwJiFME Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 11/27/22 11:22, Igor Korot wrote: > Hi, ALL, > Table pg_indexes does not contain a field for a catalog. > > So how do I get that? > > SELECT 1 FROM pg_indexes WHERE indexname = $1 AND tablename = $2 AND > schemaname = $3 You did not look hard enough, or Google "postgresql pg_indexes". test=# \d pg_indexes             View "pg_catalog.pg_indexes"    Column   | Type | Collation | Nullable | Default ------------+------+-----------+----------+--------- *schemaname* | name | |          | *tablename*  | name | |          | *indexname*  | name | |          |  tablespace | name |           |          |  indexdef   | text |           |          | https://www.postgresql.org/docs/current/view-pg-indexes.html -- Angular momentum makes the world go 'round. --------------DjetLsOTuaJoRrAbcEwJiFME Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit On 11/27/22 11:22, Igor Korot wrote:
Hi, ALL,
Table pg_indexes does not contain a field for a catalog.

So how do I get that?

SELECT 1 FROM pg_indexes WHERE indexname = $1 AND tablename = $2 AND
schemaname = $3

You did not look hard enough, or Google "postgresql pg_indexes".

test=# \d pg_indexes
            View "pg_catalog.pg_indexes"
   Column   | Type | Collation | Nullable | Default
------------+------+-----------+----------+---------
 schemaname | name |           |          |
 tablename  | name |           |          |
 indexname  | name |           |          |
 tablespace | name |           |          |
 indexdef   | text |           |          |

https://www.postgresql.org/docs/current/view-pg-indexes.html




--
Angular momentum makes the world go 'round.
--------------DjetLsOTuaJoRrAbcEwJiFME--