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.96) (envelope-from ) id 1vwbhX-000qB0-1v for pgsql-general@arkaria.postgresql.org; Sun, 01 Mar 2026 07:58:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vwbhV-00CcOq-2v for pgsql-general@arkaria.postgresql.org; Sun, 01 Mar 2026 07:58:53 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vwbhV-00CcOh-1q for pgsql-general@lists.postgresql.org; Sun, 01 Mar 2026 07:58:53 +0000 Received: from mail-yx1-xb134.google.com ([2607:f8b0:4864:20::b134]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vwbhS-00000001qON-2yuZ for pgsql-general@lists.postgresql.org; Sun, 01 Mar 2026 07:58:53 +0000 Received: by mail-yx1-xb134.google.com with SMTP id 956f58d0204a3-64caaacb9bcso3272338d50.1 for ; Sat, 28 Feb 2026 23:58:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772351929; cv=none; d=google.com; s=arc-20240605; b=jqRwdWihEVS3y9UnhLAdzLoJQuDRZx4cWkPvBEdr2fy0Zas31fSAI85s47KKcYf9jD /p/k3R8zg2fJ8KTLjwuDHnWau0ns7Tv+PRWBSaiZndHWmSbwYhwHvSxyRYj/Tk7+FRGW qSEpyOVEst/5DMzZPEsqkAm6ztKFBM7hikwEBHNG+1XGWspRR/0Xxj7Jc76N1vTX6nXm kjYQbvc6QTdmqvBgqF/g1xNVQ4+BSvKgrWZlfj6M+EYcsUdKqu95i9IekHhlu/prok46 2VRAnE6+uXMEij1RefE2V+JXyxyXQyRs28/ivh5Zc++w9hdl/J+JViKfbyAQ7CkPrWM5 oAYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=OK+4bCUEppBXuEq3hxdHXNcA9Mfb/8xmh85T5VQGsBs=; fh=kyAsYl77KsxRDd0MpChrI1Mi1G/EXxKHRVc31UaZmY8=; b=lCfVc3UXXl1k/vmwixpTDG3gBfdelijM/KCxMAKu/2qstAvmwul7SrCQFO7hpfjw0r UBsiJ3ziuHEx7+rIULQeLSHZS04lV3IJZb3xdssnswRfMBtZlwaF0leodfYpIERf2Dts NCUgMAuJ/0LVtAMMu8mIKmhL71Z5kkUbFFJzHSEYuWbPGhtwzOLoQlMLE9bmdKEdlkTc Y3hscSusy465peS/q19btldOx0wY0/mq4ezoZoVug8P/L2viGGvZMJDaigh48rlvdxyH z1aIBTLQaERu/KsmsSa/KSCiMS6piUeGAuqciHO44G5m1q6PQGe8HYNtcU88Q/szZf13 mcRw==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772351929; x=1772956729; 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=OK+4bCUEppBXuEq3hxdHXNcA9Mfb/8xmh85T5VQGsBs=; b=XLI2VQL6CcjH0J6EFOvepbHeER+NZ9Hx0/dodCSjO+UF+d6nNwljxkBR/XyYFAborU 38qPCMr3PI8kQ563WVqqILPtmIzvEn6a9EBGnx3F5roxBxoTk+5RDPAZIu+5+sthpJ2/ 41ydmLWeL9QPp/Tc7Na2fOd/oIfpPnfdBlqJ1ycv0O9GBlmneUGvgXOPMQsruofaRLXI 9V2Ev/qKwDBQ17lwfXPoEuy25WfN5bwPWwyMN5rfYY09hhes/kMfdF5igibsUV3duJur zPeggAPcMpyw/j1cyoYFlSspnTQI6SXr64VSi2hYkmBAXCkH+6OlGUTBL+G+XtjxVgqM Gn0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772351929; x=1772956729; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OK+4bCUEppBXuEq3hxdHXNcA9Mfb/8xmh85T5VQGsBs=; b=FKU5A4Q5wv83DS+c5fwDf1Dn8gbHHzdjRFQK9mqwMm+4x7U/m3P4uHay7qGnFAywIj aZIzh0/K+ooRJLIeZqQ8Om/E2SBckeh0GWAZF3jUUIjmYmlC+pOUdsFW7pAWbDMjiX0K 7GW2DzSLTamhGyFpFouvT68XJ4CPokFPM5jkz82bcmGYowSXVsz1Kqx69TOEyr+2QRWe zITw9Tz4uA5f2yut0xKcL1i+dBDqQGgi2pXCxJqEqXS2vzidERLFNQWwyHWzd/JargMu 3IOFFvbgtYGZnL1FFteVIel6WQuHo//wsFEVwJWuHIL74d4VV75uOqoKwj504UXGn8xV Zstg== X-Gm-Message-State: AOJu0YxJJZsuI9Rptz1dl00DL3bbEhcReTzre6jRHWdqhb0eubThDh6e bV2DtAnOhvxzRYKBAMrj+SNaFhSUG2/OvHSFqguQoeunEJp01X5zKthoA2JM+vwbxpDN3scEvC5 U5UhGYo6OuVYL7tPTBwgE6cPZWyWHJ9W9KQ== X-Gm-Gg: ATEYQzxVQfEdcD/qLepKyYmE7dK31UDN4DTO2aw/pmvvU+5kFjPusw6LPNdDc+23jxh fklwstumuwdn3ugU+di36WEYlV2xwprYcaNscxOgDD0pW76zVRRB503qOg11SZDre1N1QQhQVqn unf4khoh7oMm3rePLv0br46IEzEqMuCpi4RNOty5ysVVCp/xmy/CfsomdnLaWEzMLFg52e7sOqq ESX0rjedHnIj+W8nXZJCVIxf4cIAHi7muRvPey1GOlyfOlgLaxSkqt04hRmeFOjEKhvME09U2wO iSx5EkvNqJBzIAVcdW+Q8A== X-Received: by 2002:a53:ee55:0:b0:64a:e3a6:c397 with SMTP id 956f58d0204a3-64cc222aeaemr5657331d50.45.1772351929037; Sat, 28 Feb 2026 23:58:49 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Igor Korot Date: Sun, 1 Mar 2026 01:58:37 -0600 X-Gm-Features: AaiRm51NHHI_BxW0OQCwbRm5eBktvxWvgfYozFP2SAStyGSRFC76u36moldcTUw Message-ID: Subject: Re: Where the info is stored To: "David G. Johnston" Cc: "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 It would be interesting to know what to bind ARRAY column in ODBC code (the type in the SQLBindCol()), but that's a different topic which is probably OT here. Thx. On Sun, Mar 1, 2026 at 1:50=E2=80=AFAM Igor Korot wrot= e: > > Hi, David, > > On Sat, Feb 28, 2026 at 11:49=E2=80=AFPM David G. Johnston > wrote: > > > > On Saturday, February 28, 2026, Igor Korot wrote: > >> > >> > >> draft=3D# WITH idx AS( SELECT i.indexrelid, i.indrelid, i.indnkeyatt= s, > >> i.indkey::int2[] AS indkey FROM pg_index i, pg_class ic, pg_namespace > >> ns > >> > >> > >> WHERE ic.oid =3D i.indexrelid AND ns.oid =3D ic.relnamespace AND > >> ns.nspname =3D 'public' AND ic.relname =3D 'leagues_new' ) > >> > >> > > > > I doubt your index name is leagues_new. That is probably the table nam= e. But ic.relname contains index names. > > With some trial and error I think I finally get the query right ;-) > > draft=3D# SELECT c.relname AS name, ixs.tablespace, > -- Get included columns (PostgreSQL 11+) > ARRAY( > SELECT a.attname > FROM pg_attribute a > WHERE a.attrelid =3D idx.indrelid > AND a.attnum =3D ANY(idx.indkey) > AND a.attnum > 0 > ORDER BY array_position(idx.indkey, a.attnum) > OFFSET idx.indnkeyatts > ) AS included, > c.reloptions AS storage > FROM pg_index idx, pg_class c, pg_namespace n, pg_class t, pg_indexes ixs > WHERE ixs.indexname =3D c.relname AND c.oid =3D idx.indexrelid AND t.oid = =3D > idx.indrelid AND n.oid =3D c.relnamespace AND idx.indisprimary AND > n.nspname =3D 'public' AND t.relname =3D 'leagues_new'; > name | tablespace | included | storage > ------------------+------------+-------------------------+---------------= -- > leagues_new_pkey | | {drafttype,scoringtype} | {fillfactor=3D= 50} > (1 row) > > draft=3D# > > Thank you for sticking with me and sorry for the trouble. > > I am getting everything in one DB hit and the query is not that big. > > I am only worrying about tablespace filtering but I think I got it > right. > > Thx once again. > > P.S.: If you see any improvement - please by all means do let me know. > > > > > > David J.