public inbox for pgsql-odbc@postgresql.org
help / color / mirror / Atom feedFrom: Igor Korot <ikorot01@gmail.com>
To: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Does included columns part of the PK
Date: Sat, 14 Mar 2026 02:12:42 -0500
Message-ID: <CA+FnnTxyucDH_YUoX_r-J80bcMcZMG=iFOYwLL9iALPKLJkUsg@mail.gmail.com> (raw)
In-Reply-To: <CA+FnnTz7+dbyk5Gn2iM-eo1Xvfax15yjBevmCCfvo0-UVW1K7Q@mail.gmail.com>
References: <CA+FnnTz7+dbyk5Gn2iM-eo1Xvfax15yjBevmCCfvo0-UVW1K7Q@mail.gmail.com>
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="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="python3_11 -python3_10 -python3_12" 0 KiB
[ebuild R ] dev-db/psqlodbc-11.01.0000::gentoo USE="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 AM Igor Korot <ikorot01@gmail.com> wrote:
>
> 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 =
> tc.constraint_name AND tc.constraint_type = 'PRIMARY KEY' AND
> ccu.table_name = $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 =
> col.table_schema AND tc.table_name = col.table_name AND
> col.table_schema = $1 AND col.table_name = $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.
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-odbc@postgresql.org
Cc: ikorot01@gmail.com, pgsql-general@lists.postgresql.org
Subject: Re: Does included columns part of the PK
In-Reply-To: <CA+FnnTxyucDH_YUoX_r-J80bcMcZMG=iFOYwLL9iALPKLJkUsg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox