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 1ozPr0-0002fU-JE for pgsql-general@arkaria.postgresql.org; Sun, 27 Nov 2022 22:10:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ozPqz-0003Js-8u for pgsql-general@arkaria.postgresql.org; Sun, 27 Nov 2022 22:10:25 +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 1ozPqy-0003Jj-T0 for pgsql-general@lists.postgresql.org; Sun, 27 Nov 2022 22:10:24 +0000 Received: from mail-qt1-x834.google.com ([2607:f8b0:4864:20::834]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ozPqw-0005VD-BF for pgsql-general@lists.postgresql.org; Sun, 27 Nov 2022 22:10:24 +0000 Received: by mail-qt1-x834.google.com with SMTP id c15so5637208qtw.8 for ; Sun, 27 Nov 2022 14:10:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding: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=r3ve5DuOZmxUMiYp6P6yNPSiD7G2EFaLYKExFyxYnjM=; b=DY8sghsj5QncQcXCAVCjYOF5WRZlXJJab9345NuvLX64Hx3HsedTAcLd5zIYAhOVUT gMl7OpTmE4JCMwfuO/KqrK66N7V3CW7ZLwtRWkXwfrB8dAhc1yGyxv9NYc5Bu4FwQXVl 2eoHIYWuhdSNdZmfO4JqsgNIcjuXz4x/kjqJy0sJGi2AVzSacJjpofwtvgHJgWotlszf 3pM9mpGC8CAaRykixSR4wQFodsa87R7j7sj6jmTgoVV9XoQD+nBnUwq0WKgfdI0mPC/3 db2z5mqTmf7hGZMriso66pGhJOqCyAn39ZuesL2PvMyrtEsq/amErV9zED3n3QFhzDky q+nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding: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=r3ve5DuOZmxUMiYp6P6yNPSiD7G2EFaLYKExFyxYnjM=; b=V2mihANqibI3iFx1qifyfYKDOO5b6SKkokNrp1wRKXruFdAP+0qs1MyJhVM5MgAob3 fkaL7+VKgO0MHTz1GqUd8HeaToI7vt3L1Han2nQubIJ5GLVu61wRYxVL/SXIUXCDCoVS t4OMHtBklvV+RQJD92Uapl0uztCmAReG4GBdoUAYDxwsqjB1L1sUkjfVRUr0xgP3XR+0 fhKdzc9FRHTTc3f6QFkKUmKa16mmhCS0hUnq4zO34NOpJneSaqMfVBiEstENwGclRzD9 mfEQXEIH8mpOk2Nz6pLhoC5lG3jolVkt64jCZlJRP+GrWhXYv8/vX0gj/E4pj2s7xr3B rgbw== X-Gm-Message-State: ANoB5pkgGIbtBysnsPkBw1oGEXo258MGT5x2UGogj4HBJwMA7/zD4vZ2 snJNFzh6jkiLQIecE49Az/s6BIvU7iw= X-Google-Smtp-Source: AA0mqf4LF4ERCbpf7CzXnl8PvavE3vGrP66F+GP/qjv80iadH7SvizQHGQU2i6JAVqYl8WMZrPbEXQ== X-Received: by 2002:a05:622a:6114:b0:3a5:350b:b6d6 with SMTP id hg20-20020a05622a611400b003a5350bb6d6mr45279763qtb.130.1669587020618; Sun, 27 Nov 2022 14:10:20 -0800 (PST) Received: from ?IPV6:2600:1700:bd2c:b810::43? ([2600:1700:bd2c:b810::43]) by smtp.googlemail.com with ESMTPSA id a7-20020ac84d87000000b003a66cd05c51sm4219671qtw.72.2022.11.27.14.10.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Nov 2022 14:10:20 -0800 (PST) Message-ID: <5ef334f4-7d7c-0106-9a47-843586706ce6@gmail.com> Date: Sun, 27 Nov 2022 16:10:19 -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: Adrian Klaver , pgsql-general@lists.postgresql.org References: <467d46cc-553f-0014-5a09-6ddf7ccf4fdb@gmail.com> <9b91c29f-15d1-a997-f542-e04a752f7944@aklaver.com> From: Ron In-Reply-To: <9b91c29f-15d1-a997-f542-e04a752f7944@aklaver.com> 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 11/27/22 15:55, Adrian Klaver wrote: > On 11/27/22 13:31, Ron wrote: >> 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 > > What the OP was looking for a field in the above that was catalogname or > datname per: I've never heard of a database referred to as a catalog.  (That's always been where a database's metadata -- i.e. the pg_catalog schema -- is stored.) -- Angular momentum makes the world go 'round.