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 1uginX-006h8v-Al for pgsql-general@arkaria.postgresql.org; Tue, 29 Jul 2025 11:47:12 +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 1uginU-000Nyb-RK for pgsql-general@arkaria.postgresql.org; Tue, 29 Jul 2025 11:47:09 +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 1uginU-000NyT-D1 for pgsql-general@lists.postgresql.org; Tue, 29 Jul 2025 11:47:08 +0000 Received: from mail-yw1-x1130.google.com ([2607:f8b0:4864:20::1130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uginS-001NBS-2S for pgsql-general@lists.postgresql.org; Tue, 29 Jul 2025 11:47:07 +0000 Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-71a206ec3a0so10481727b3.0 for ; Tue, 29 Jul 2025 04:47:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753789626; x=1754394426; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=vT4YWkVN061hjhbCHtIKht2HShN/XSFnPPD5Y/VTP1w=; b=C/RQXHDU4okvJIdMDVvZasc9Wunn7E32752/e8nbDtvB/RX3NXqC1sOyxZEWjp/ILM l8+zD3TNIO7KHJ1milfz7qP/b3NhW7gyKzppl1zwsy5qTeODPhPOtc2U6DaYZZnJe5Oa s9C9jparOcECfkomPj2jtpIwKWyQgKkh15r2Ry9dLALa9ACPc5KkaBXBjKKl9MiNKg13 lXxTZ6WytxxTgNgsGnYGTmvB4nTioqZ40B1UXEFlNmIb6O/DzOUGCmOZbOG1vvmovPnq vK3afAWfOIEAtZAT1yFzTXUok9aMADcX2MU+llB8W29dmmgv0NkDKCVqdDv408xFY3ig hPGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753789626; x=1754394426; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vT4YWkVN061hjhbCHtIKht2HShN/XSFnPPD5Y/VTP1w=; b=cDobsTENDADGwrytEZI+4sq+b3BJQSBXBJHErMryXeHIhWkA5DNcpNK0F5NFp/06W0 1rQMPNVSDmmfLpzb5YafbwgNBy7qWaCiqX/Q5GwlpgbvmG14PrmDkZO/XtAnzeXArWJS wu49IRNe5W7vJlnygV6LtlWaNZKskB0lXtYLfVZMCA0vrQb/V91NfggU2eNDKnLuRwHU 2s/o+ySilHKbQGFtDa+Safai1bc+bB1+/MoOJHw/Phvr5r/yydc6gEUg/H9mp4uCC5xX eq57MOfNlIddtEHqgXVzk3c+FNFAlznVbrg0mwHWlyiUWXamU4+SiMWYmv4HIzKBcJrS RkyA== X-Forwarded-Encrypted: i=1; AJvYcCUs6SpWGoecB49Q+GZkw2rHMxF6tXxPrH4IR86RubuDM3Rp4bKNCVXzXXJH50RLxtbUaKebE1sFc6lJ10uO@lists.postgresql.org X-Gm-Message-State: AOJu0YxZHQuhbmANsLtAXk7Sq7MqYbEp6ol+5OuhFJ7WWRo+5Z1iy3/l JSPL8l1ypQ/aDhalEa6YdP0NjZTAfWhI2d1TqJit4FJjnQ6NoKsL0dMp5o8NXJR30d2MnaINRKD Kh76MKI81SP2WIfkL/l2SY2+Rhf6vo6Q= X-Gm-Gg: ASbGncvunEOoMKLwXQDeJ1uSW7HDzJcdReP9hYxdP6BasLar2fKynkLlduOSrO9p5ah EYuyqph7szNKl5hNLy/60K/flWDAIFYglO4ThbN1fjDgMnfqrOIUueKUcCwkTk9d36SjZEoPET0 koXCg5WZGgiz0/MDkeq8oArs9re6IyWIIeexp32Px3tWEQYwY/CRH66L86sZMlyvXmMn/5ow+8p K0AG+GYkX4jqIYDyUUOjg== X-Google-Smtp-Source: AGHT+IGIvMSlT/2MOkfFagKl7L29k3SdZZEdHx6nDyxbEjMBRNc9BHTUiVZLRvTF+4nSprENJtiWCKuxYp4y6kVVp+8= X-Received: by 2002:a05:690c:a0a3:20b0:71a:20aa:2265 with SMTP id 00721157ae682-71a348842b8mr28179697b3.6.1753789625752; Tue, 29 Jul 2025 04:47:05 -0700 (PDT) MIME-Version: 1.0 References: <090d8588-e74e-4436-8f69-05ce8624379b@aklaver.com> <0BC8BEBF-3B1F-4E69-A1B9-CCCDF9617168@thebuild.com> <7281c379994ffc70cebb68423f5b8ba339d0d75f.camel@cybertec.at> In-Reply-To: <7281c379994ffc70cebb68423f5b8ba339d0d75f.camel@cybertec.at> From: Igor Korot Date: Tue, 29 Jul 2025 06:46:53 -0500 X-Gm-Features: Ac12FXxD1tla9rWRGmgmNPNBWmpaNWhqYNvBJiDrigvpVGWI8FUh1annv05076E Message-ID: Subject: Re: Get info about the index To: Laurenz Albe Cc: David Barbour , Jon Zeppieri , Christophe Pettus , Adrian Klaver , "pgsql-generallists.postgresql.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, guys, On Mon, Jul 28, 2025 at 10:13=E2=80=AFAM Laurenz Albe wrote: > > On Mon, 2025-07-28 at 08:19 -0500, David Barbour wrote: > > Couple of suggestions. You might try ChatGPT. > > Please don't be insulting. He asked for real information. I finally formulate my google request and got this: https://www.google.com/search?q=3Dget+the+index+field+info+postgresql&safe= =3Dactive&sca_esv=3D32011946fbc5f18a&ei=3Di7KHaLSSEK6f5NoPpO-IgQ8&ved=3D0ah= UKEwj0g_agieCOAxWuD1kFHaQ3IvAQ4dUDCBA&uact=3D5&oq=3Dget+the+index+field+inf= o+postgresql&gs_lp=3DEgxnd3Mtd2l6LXNlcnAiI2dldCB0aGUgaW5kZXggZmllbGQgaW5mby= Bwb3N0Z3Jlc3FsMgUQABjvBTIIEAAYogQYiQUyCBAAGIAEGKIEMgUQABjvBUjBfFCyWViwdHABe= ACQAQCYAYABoAH_BaoBAzMuNLgBA8gBAPgBAZgCB6ACoAXCAgoQABiwAxjWBBhHmAMA4gMFEgEx= IECIBgGQBgiSBwMzLjSgB-0esgcDMi40uAebBcIHBTAuMS42yAcV&sclient=3Dgws-wiz-serp SELECT t.relname AS table_name, i.relname AS index_name, a.attname AS column_name FROM pg_class t, pg_class i, pg_index ix, pg_attribute a WHERE t.oid =3D ix.indrelid AND i.oid =3D ix.indexrelid AND a.attrelid =3D t.oid AND a.attnum =3D ANY(ix.indkey) AND t.relkind =3D 'r' AND -- 'r' for regular table t.relname =3D 'your_table_name' -- Optional: filter by table name ORDER BY t.relname, i.relname, a.attnum; I can build on top of this query, however I have 2 issues: First and most important one - they are filtering by just table name. How can I filter by the fully qualified name - catalog.schema.table? Second - how cn I get the partial index condition? Either the whole WHERE clause (which I will have to parse) or the broken down one (field, condition {AND|OR} field, condition}? Thank you. > > Yours, > Laurenz Albe