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 1w1JBE-000Bnq-2O for pgsql-general@arkaria.postgresql.org; Sat, 14 Mar 2026 07:13:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w1JBC-001B3J-13 for pgsql-general@arkaria.postgresql.org; Sat, 14 Mar 2026 07:12:59 +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 1w1JBC-001B3B-00 for pgsql-general@lists.postgresql.org; Sat, 14 Mar 2026 07:12:58 +0000 Received: from mail-yx1-xb129.google.com ([2607:f8b0:4864:20::b129]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w1JBA-000000005Xw-0Lfd for pgsql-general@lists.postgresql.org; Sat, 14 Mar 2026 07:12:58 +0000 Received: by mail-yx1-xb129.google.com with SMTP id 956f58d0204a3-64c9707fc11so2142984d50.2 for ; Sat, 14 Mar 2026 00:12:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773472375; cv=none; d=google.com; s=arc-20240605; b=MrRUG6gjCpu36VOoumIEejz62s4YJeRHWEqOrd+cwI3NIIsWEq0+xd20bR9uZf6Wug /Gn5uui0befl2g/tU8s0pURQKkH2KyvamJIteXaneQMgqQtYuFCXCquWF40pVA81i87s lio6lQyng3bIFUPM4veVmbdourYeayIti3nhYShW9pi9ExFMTVOMqDz3llrmPVs8Y+XW 39txqkgisvlfa5Oq3IEU6xQtw+9afCycHaFOVS5nthsXoBr+JVhUemEohKsM1svDWi2r now77Aa/afzISoSchrtMk21I27S743qvDxXA+qYy4PAgCKsuoxEI0gYvGw/qDerOmSVi 4vZg== 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=QZpqprdzygqVtY1/9lcKPfV8Xba/joFzYQhUgHTOHMY=; fh=2DoGC78b0mi8uZ4UY+9ocPF86GSVzeaJWqou/x907js=; b=TWJJXFJgam8BHJ+gtes6i2KEK4SKJ+Q1tdRPgJPDZsWqoBmYn6LailbAXfAhUbAKay g2rbwimgcLucaRF707qLp5Y6LzBv51aAwPuih8C46Y7YdBqLHv6RMZwDzocxOBuSLZQt MQa9lQ1BBE7pOqgojahubZE4KEjQNixXz3uDrOO0djxW0J0PQ0U0Pm0TX+NX96cendcN TTMOvzMD4Iqt0z6Dfd4TJSzuc2M+4kpseqYhtWLLjNk5xHgn1VaL6S+TOpA6oHRcxTbt XBzC0+VkLFr51rYq4bkWr+3OTuurp4+AnntPUxDho1gUiy/dRp8tZHVM98B0cmcvy9dT LwGA==; 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=1773472375; x=1774077175; darn=lists.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=QZpqprdzygqVtY1/9lcKPfV8Xba/joFzYQhUgHTOHMY=; b=C3lbbMP5lSUePk/00QxLhBnbRWzLnZW/yHuHipAsjYRDCh1XOzJ4sldjKSBijSSEfP dGIJhmtcB0/IRY999/qs2b8vEgiQ7mLtyDMVdCJirZsatd1qXeXvgBpReaPHjWXgeYP2 Hj5ZO86S2gY9+qSW0fYCRG2YWkFM4enlcBGLvMSrqIZiBvFmKXnmsCHiM1EWsBaVuWy9 JOCVSYUMunC/jEyuEO/3wg3gGrMujedTxgkV/4kZokQlc5C692J4uCz7a5G4xp7nde5m TaI8sH+FFpYfpVD3Q9M0YycDqYD1MdgxP/ZXtDN4udGOIY7vzE+uOHlVCfy3x4vY45Wr ERhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773472375; x=1774077175; 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=QZpqprdzygqVtY1/9lcKPfV8Xba/joFzYQhUgHTOHMY=; b=UX5I/l83xo8bMALtG0UchfgFRhpdkGGwrBoW4YnUaHCbmnXHXujlLlDPDuoU83ndzH rQ/VeXbZCCdrskyrj9CROMGtrazOWEtNCUyOKINDH9bb8gF1TovOUE6hTGubkW6BPWvg 0RS4HIqKf89JYunnC1hFXcvju81WwkQmIRnJeicv35B51m2O1fN+c14dX7P6yH/NNzOS v2X2fjMwknP1cxmte1m7yMn6xpOavv40IBtztVYdWthnDjVajv/40E37QgVob0vgkLhE fUBC10oFvdVhSc2/1qN96PvoYp2nt/lPWlXND7LM8FA4rtEdpsbxXZZMlFfk6CSmLVgL 8bjw== X-Gm-Message-State: AOJu0Yx2zfelGRkY72Yf40SAC0FMTM3Dz8ZCPYukxdWctE5e+l/jKk8a 3Kl+9eRoWUuiaDzYfD39EIPLlf6oCW/6yvzCfZSBojYeKbreqN0nPImUpbdA4+x7uHZ52low3dW w5biOJRHpXt4D77i7Avfmgf34JQyKJ8f8hJ2A X-Gm-Gg: ATEYQzy7PtRRSYBNLs+WePqbhBMi6PrndLRAJg8GE6+hE6WV8ZrXQKhaR9JadTPdNXs xS2ZLa4SjmbDySwJnHSZm5d0uy8V9kpqyTO94NKkiwnFXgR4lUcJKx3VOv1JICnPzF6x2e5MdYC FBzf9NzXJrUPKRFo3RH7chGsP+xyTLJP6gW25iqJjcq7BKpLqApzQ1lptbWOYpNq5cgbmhlfo8N dgKC06DiTqF2StwyodBjYipRjFAlmAG2XS+m49h4XI1PJTeO39ouWuXbGo6OXeaQuin7wYy67rV QfdMjwXhy/5G4rDic9k1E9CRObnP6ZLT/SJdxJhPt5yRTY4E5cJxKu86fmL99zvy X-Received: by 2002:a05:690c:dc4:b0:787:e9bc:facf with SMTP id 00721157ae682-79a1c1ffb1cmr65739377b3.50.1773472374994; Sat, 14 Mar 2026 00:12:54 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Igor Korot Date: Sat, 14 Mar 2026 02:12:42 -0500 X-Gm-Features: AaiRm52aB8UiaQ6xUFeS-kSpE0EbNCtjVho7U05JfOnllSquLx1A80OmJOXfTNA Message-ID: Subject: Re: Does included columns part of the PK To: "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 Below is the version info I use on this machine: Calculating dependencies... done! Dependency resolution took 53.38 s (backtrack: 0/20). [ebuild R ] dev-db/postgresql-16.2:16::gentoo USE=3D"icu lz4 nls pam readline ssl xml zlib zstd -debug -doc -kerberos -ldap -llvm -perl -python (-selinux) -server* -static-libs -systemd -tcl -uuid" PYTHON_SINGLE_TARGET=3D"python3_11 -python3_10 -python3_12" 0 KiB [ebuild R ] dev-db/psqlodbc-11.01.0000::gentoo USE=3D"ssl -doc -iodbc -threads" 0 KiB Total: 2 packages (2 reinstalls), Size of downloads: 0 KiB WaylandGnome /home/igor/dbhandler/Debug # Thank you. On Sat, Mar 14, 2026 at 2:09=E2=80=AFAM Igor Korot wro= te: > > Hi, ALL, > Have one weird question ;-) > > When I connect with ODBC and call SQLPrimaryKey() the function returns > all fields including > "included" fields. > > However running libpq and trying to get the table info with: > > [quote] > L"SELECT DISTINCT column_name, data_type, > character_maximum_length, character_octet_length, numeric_precision, > numeric_precision_radix, numeric_scale, is_nullable, column_default, > CASE WHEN column_name IN (SELECT ccu.column_name FROM > information_schema.constraint_column_usage ccu, > information_schema.table_constraints tc WHERE ccu.constraint_name =3D > tc.constraint_name AND tc.constraint_type =3D 'PRIMARY KEY' AND > ccu.table_name =3D $2) THEN 'YES' ELSE 'NO' END AS is_pk, > ordinal_position FROM information_schema.columns col, > information_schema.table_constraints tc WHERE tc.table_schema =3D > col.table_schema AND tc.table_name =3D col.table_name AND > col.table_schema =3D $1 AND col.table_name =3D $2 ORDER BY > ordinal_position;"; > [/quote] > > I'm getting only direct PK fields. > > I presume that libpq is correct and the ODBC driver is the one that > needs to be fixed. > > Just wanted to ask this list before going to complain to the ODBC list...= ;-) > > Thank you.