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 1w2Fsp-00082r-2f for pgsql-odbc@arkaria.postgresql.org; Mon, 16 Mar 2026 21:53: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 1w2Fso-00DbFc-2Q for pgsql-odbc@arkaria.postgresql.org; Mon, 16 Mar 2026 21:53:54 +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 1w2Fso-00DbFT-1d for pgsql-odbc@lists.postgresql.org; Mon, 16 Mar 2026 21:53:54 +0000 Received: from mail-yw1-x112a.google.com ([2607:f8b0:4864:20::112a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w2Fsl-00000000Urn-3gPY for pgsql-odbc@postgresql.org; Mon, 16 Mar 2026 21:53:54 +0000 Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-78fc4425b6bso49042167b3.1 for ; Mon, 16 Mar 2026 14:53:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773698031; cv=none; d=google.com; s=arc-20240605; b=R1THW+q9WfRkmlrMoytUiqRFfr8vNxNaUSKKXbagGmegfTiXKI9MUpyCm9rlT49KtE ekpIkPCdZfsnROvzDET25XGsTXrIFxEzJq1DL7ZLoArzRQWZj02fPAaXZxrumCCNlPGU kTVjibvHuJnDxTrvYoSPQ9YC91mcWJx6Z31V/aoAXy6p7bPtafsY/Rl1deqGJnAWTOTU q4w+S7NX//ACxvAFXMtmmXnmcYxvtrYcUxPIXLoW2jk19jVjvBbDPVb37o8in8ii5y55 NUlg/fRQ8O1PbnirkFFkHKNKE4govF9h4WzpeMe+cXOVLVAdPbknub1vDo/5g39hBq93 OBDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=GHPMsLamb1Cpswvg7sbu29nJ+i1zp9OCUNjIbKBhuDk=; fh=I7Abg2FSk4dZ5YFK3dKcW4Tb11Z2/mGWtRl7WZ6vSgI=; b=iW6DzfNCRw1hUb4h5AdImcrnApirkVAez5fjFIFMJvAll+IT/POdj7SYS2F3H/adi5 gsxJhIHKw+ZQhsAqVmrCBzclo8ewawp/2RD9zvamMSAD0jjY5BHpQbf0JyY8nYoWdMfw xhFNHM9AQkzgad0WvlRHHe1y9Cs+H0DC6pnpqjZ6qIMkvxPyAxP081SISIoAvtO3AftW Ng7dlLcimR80vmOREeLndCEdkn8zAw2nWuQHcmmciJPhT8ih9LScJRn3e7DVF5awiYd+ fRUu1vTa1hkwVyqWJh5UEpYJqrBicViT92A1LcmvgQ1kWVUkQu2kmFtxzaCUCATls9J7 UK+g==; 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=1773698031; x=1774302831; darn=postgresql.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GHPMsLamb1Cpswvg7sbu29nJ+i1zp9OCUNjIbKBhuDk=; b=SYanr9K0FjoZfywNGN35Y4FiAwWM/7sZoj33cVaNrLhkyQXhW+dARG8nHTJR8dSZAS OVzAxPcBUkZ1iLqWofx2UzS7hyRLP6yCzucO8Alca8Uuc++AV4A8fxNFph9picw+tFg1 eQ2iWQ6TZJqRx2HAHBdFI7mYZ4SBugeNgI618VNEGVS2wP/gV8iu5xbCJ5zEgLg0MpXW 4nPo9BEkejr57hPS/k5Pyt2jV3PeglJ0RfvFNQW2MjjxSbCk2kp/SwHhioPTKF8Ec/br iqwkuK5nV84zs0d/S04Du6G8Fmi/feWAo286kdSIO9m+36L6JsKMDS/ZNV9/Z+BKrDsW 6l/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773698031; x=1774302831; h=content-transfer-encoding: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=GHPMsLamb1Cpswvg7sbu29nJ+i1zp9OCUNjIbKBhuDk=; b=joCJdQlvPBu+eEKnrgAHfA2e68t90blAnZckQKkb3FBMHbFJJMjYfYZh4lDhEZDf3q zr5bneuvdFsxnhcDWfnL1wezqmnHv5FBPIvwV2pLwAcEkWJglNRIOayEte77QdA1yrCc mc2sIEG4ItCFOEVj3gDc/ebgaMeR3IYIuiojYDnvhU5yOpljplMbu0jCqGtBfS5ptX1d jdh4qJDCKKkmvASUP6xYR/tVKmsUScEiDNGVFkyBlHEIGtvDsa8LUD+XEgSLQ5T8O8v8 p4eXfU2llgq/nOugZjUD18f2GCKYDK4+91RmRHoKTLeLmh3LFHZu2xnhMR41cv0HAImq saEw== X-Gm-Message-State: AOJu0YyrHOdueNPT4MIRRwClz2UwxHpF09jBcgyaEBsKVeKgblMC82Wl b6/EVjTT2QE16wIXCGrrtyUOyqLXZlMSD8xHJWMpoaOeC8r7txFpkr7Wl3o5lL/dX5oSV1R6+uX qm8Ye2Du0LUVWWnfnR/OwBhe7DL5b9bMDXg== X-Gm-Gg: ATEYQzxWFJ/hucbd0qsv6AF/ehyHfl/ShHExZl3dtSupPfCP++zXBOVPFmjo4rRdzYr +51/Hjr8MUlrlz143OAlqR+YGnI1qq0zo3NKQu/Jj1K6We9be2XlNgvB7Iqotu1q73HNtpkD7oQ uNT5n3LG5aWWNL3cbHv5KKfcIIOzKIg/Pz9POKxtL59sf5brM4N3csB4dvCXOR3gqe1fo7c5mro 5D8+freWn3CppJlSfDrXc4fNaeBhb+abnsNrPyR3OoJqG8iBkTHdTnvnzli9DqIO23cmvfuq+gV 5Ll8jdJkgTaBwrxTAzxPmrS28jCrAjMRst79figvNUGPeVEIQOpndbuupVC61PwGX/rsRkA= X-Received: by 2002:a05:690c:f08:b0:796:6da9:bf97 with SMTP id 00721157ae682-79a1c1c002emr148916357b3.43.1773698030593; Mon, 16 Mar 2026 14:53:50 -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:53:49 -0700 X-Gm-Features: AaiRm52KWQFIxk5rhfkYX53Iig-wC7OFqxFYxUBPc0YxhkByvrVAMwcGv8QBk-M Message-ID: Subject: Fwd: Does included columns part of the PK To: PostgreSQL ODBC list 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, List. This is what I found out. Could someone please look into it? Thank you. ---------- Forwarded message --------- From: Igor Korot Date: Mon, Mar 16, 2026 at 2:51=E2=80=AFPM Subject: Re: Does included columns part of the PK To: Adrian Klaver Cc: pgsql-general 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