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 1w2FqW-00081B-2d for pgsql-general@arkaria.postgresql.org; Mon, 16 Mar 2026 21:51:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w2FqV-00DYSc-0u for pgsql-general@arkaria.postgresql.org; Mon, 16 Mar 2026 21:51:31 +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 1w2FqU-00DYSU-30 for pgsql-general@lists.postgresql.org; Mon, 16 Mar 2026 21:51:30 +0000 Received: from mail-yw1-x1136.google.com ([2607:f8b0:4864:20::1136]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w2FqR-00000000Uq6-2pq6 for pgsql-general@postgresql.org; Mon, 16 Mar 2026 21:51:30 +0000 Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-79a46260385so16530477b3.3 for ; Mon, 16 Mar 2026 14:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773697887; cv=none; d=google.com; s=arc-20240605; b=fz3IeMOVphk35NnR5st8k50US5Hb7FamzqEJzBI7+cbvg6Nvb0MEOsLP3MuCJV8QP3 GsEm2fN9kcM4kBXbn20gBe0pwd0aL+s9eLiLAJES3QLnSH/ISYVV58FVW/Y+ChRVv2aD od/yZUGRhhKU8hYeM6Ndb6SJrcamvd4mnQHbfBMvUCHYaj9AL/VTvtJFFJod16bNeeOK JIqQK2mPJHz8ZusvTzSE6K7zAoy7iKKpF/uTdeVBEZUPmx/ZzFXXtDBBvW92XvdXal/a dDO5hVSe15I4p4jH4rAdTWsUxyB5fOot/C0/JzGQEjXDcBVV3oH9Baqt53n02ID/rMdg NMnw== 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=CrElO60HX8PZTjqLlrssl4Yd/akYulj1EKQ5iytd0ek=; fh=cQaUnmuwjuR9OsxDL7SxCVBwEjDYlbKL9Ym3U6WPyC4=; b=lgEwQdwuvl4aipnhOtI3zUlJYR5stDU3gUZ8o6zcHfAK++3kpyFNZFaTjN3tBTN1j8 gTVVKJCti6SAnLk1DrM27yYA/RvID+6FfpKfXKJrweLOBJQJYWmZWPByhWQsvL2h08LB oe0EKMWKjNirspF9nVDZUUCNE9cInxKaF3zpsXw2/I+t8Z4Sc153D1oFX40ZhpEDG3PE 7EiILikg9YpDSeT5LMl0oTmezCz/+kWQS63GZVPI5+i3ndJHOuriIM/16Lm1zejiiWAk i09OdyG8LsAKHgSJGtFBVbGVxD42pu7vPZ5MKKFUtJMqbhl3HeNburkf+OZ4Pas8gTN0 6pCw==; darn=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=1773697887; x=1774302687; darn=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=CrElO60HX8PZTjqLlrssl4Yd/akYulj1EKQ5iytd0ek=; b=T2zROIItVkwUEEFn0kjCmR9Zi2Cc7Eozw1LwJ+96LYlRQE6q4BBsoj0/n50NsmJGES XrJcTaGdEtbvdHQXopaAXkT1yYKI9s+UnoWq3bxLqq3zEUaBlNyQ/5k4CbcYOEeQJILE g1lAXtroS/V5I3wEkz3ZK3VubrD/IoLgJn6VVvKIiCUZDopuHYKEE6zZsuhqXCXD+wdb cJcKfxoqVrxCKPH0s54cL7l/P6J0Nnb1ucgB7Azc0Co5zDAZNgMR6DR49jfvIUDW0bk/ l35/nMJ4We6oBmuuNYDHFfoDAE1sFKhizCq1SQt6ZbFM/FZL/eNxQO0Elwy617db89wq Dztg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773697887; x=1774302687; 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=CrElO60HX8PZTjqLlrssl4Yd/akYulj1EKQ5iytd0ek=; b=b8BqGXfdCmPft47Dom7vwyCjByiE5bupAm82MoM4p8V3V7rNd4QPbjFP1ExQZaIAaR L9+iSCUj9kM8OnO1wmC8bCFAAHw2g/UH78J2jKMYD8AZuU4qzJxWIItPcvYJLYWbLZAx k3vPwClLUWs3O3tsqMLpLmthXlaoM1KqCXtj+YCLEISZMhFO9Rn8v6SHxx5KbCeJdG/G ZHE8UoJuuFcPVNo9KGhnl+wlV/1m8MpcRYWvyfEr/f/JZeUmD5q2O3qKqogOaAKfzaz+ PazDudMK50u9R61nsW6MEoFF6qP0c8+2rooFHjpmOnxEj/cm/BTW2UssTIspRL7BF1by pc1w== X-Gm-Message-State: AOJu0YzWjZ0ahUCnwfdDeU8s1BPKKHAqsT2Xm0m/aW/S2VcOzjNlUUEE N+lzCTLD2yAdsP8OYkmqlfVPyVlGyhPfJszPU6WYWRya+trS4L5uRogeddPIsNEfZsx6zi71Xey 08JWpk4aOTOMyPTjke4t83hwO9VqD6wxt0Q== X-Gm-Gg: ATEYQzyiIPqifJionR5dBdQqSHKgMEuhWqWuj3ttKl6vGU2rRRVxAsZBpqUhK/KXm53 9NSsknRJhvoV2Px0ghu4jhvYMmEhY7VE04I0AOtYuS+G5al2GeQ2bqGpKm3ZtHN4G2GXmDAnePg Nrezf1/uHtSew93e8KyNONXVIXLgNXDSjo/mrGCBfO7vmRmvL15OFLGjbCuwaJwNsrfd7RZ3ymD ebUzdnqV7AX48QylIUG189UqADeOxA20VAKHFLD4DM9shksUEwGj3lXSqYmQeiaZ0jdYyuw7hC2 CemZH6OHxOgIumzMXcWe+NoO0zG6ylYo4ZRTFx7y2cUuINtvP9Hk1MJGyQflOk6mSF5kEF9qrW/ Q/1SNlg== X-Received: by 2002:a05:690c:306:b0:794:9d24:76b0 with SMTP id 00721157ae682-79a1c1ea9a9mr145700267b3.54.1773697886672; Mon, 16 Mar 2026 14:51:26 -0700 (PDT) MIME-Version: 1.0 References: <3547f40b-08b9-4d0c-bba8-f1c26d0bf09d@aklaver.com> <2c31c118-7f8a-4359-9c4f-4cabd9df4262@aklaver.com> <7461c77a-4536-4f53-b951-99b9ca33db79@aklaver.com> <105a9d1a-c219-401a-9b81-4d77dde901f5@aklaver.com> In-Reply-To: From: Igor Korot Date: Mon, 16 Mar 2026 14:51:22 -0700 X-Gm-Features: AaiRm51srsT5wBS8ZNRCubK9PLMLh6hKxDZynz6IdLjUY9mSXR5OESXV-l6KR98 Message-ID: Subject: Re: Does included columns part of the PK To: Adrian Klaver Cc: pgsql-general 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 Adrian, On Mon, Mar 16, 2026 at 2:40=E2=80=AFPM Adrian Klaver wrote: > > On 3/16/26 2:30 PM, Adrian Klaver wrote: > > On 3/16/26 11:47 AM, Igor Korot wrote: > > > > Reply to list also. > > Ccing list. > >> Adrian, > >> > >> > >> > >> On Mon, Mar 16, 2026, 8:03=E2=80=AFAM Adrian Klaver >> > wrote: > >> > >> On 3/15/26 6:23 PM, Igor Korot wrote: > >> > Hi, Adrian, > >> > > >> > Here is the log file from running in ODBC mode: https://bpa.st/ > >> Z2DWG > >> > >> I have no idea what this is trying to show? > >> > >> > >> The log shows ODBC connection and then at the end - call to > >> SQLPrimaryKeys(). > > > > Where? > > > > I don't see that in either the link you posted or the text file Greg > > sent to the list. > > > >> > >> If you run it against the table I posted above, you will get 3 fields. > >> Whereas it should be just one. > > > > Again, run it how? > > Alright I see what you are talking about now. I'm not using the ODBC > driver just it's query. In psql : > > CREATE TABLE leagues_new ( > id serial, > name varchar(100), > drafttype smallint, > scoringtype smallint, > roundvalues smallint, > leaguetype char(5), > salary integer, > benchplayers smallint, > PRIMARY KEY (id) INCLUDE (drafttype, scoringtype > ) WITH (fillfactor =3D 50, deduplicate_items =3D OFF) > ); > > > SELECT > ta.attname, > ia.attnum, > ic.relname, > n.nspname, > tc.relname > FROM > pg_catalog.pg_attribute ta, > pg_catalog.pg_attribute ia, > pg_catalog.pg_class tc, > pg_catalog.pg_index i, > pg_catalog.pg_namespace n, > pg_catalog.pg_class ic > WHERE > tc.relname =3D 'leagues_new' > AND n.nspname =3D 'public' > AND tc.oid =3D i.indrelid > AND n.oid =3D tc.relnamespace > AND i.indisprimary =3D 't' > AND ia.attrelid =3D i.indexrelid > AND ta.attrelid =3D i.indrelid > AND ta.attnum =3D i.indkey[ia.attnum - 1] > AND (NOT ta.attisdropped) > AND (NOT ia.attisdropped) > AND ic.oid =3D i.indexrelid > ORDER BY > ia.attnum; > > yields > > attname | attnum | relname | nspname | relname > -------------+--------+------------------+---------+------------- > id | 1 | leagues_new_pkey | public | leagues_new > drafttype | 2 | leagues_new_pkey | public | leagues_new > scoringtype | 3 | leagues_new_pkey | public | leagues_new Correct. And according to the second reply it should yeld just the first record. I'm going to forward this to the ODBC list... Thank you. > > > > > >> > >> Thank you. > >> > > > -- > Adrian Klaver > adrian.klaver@aklaver.com