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 1w1J7f-000Bjs-1i for pgsql-general@arkaria.postgresql.org; Sat, 14 Mar 2026 07:09:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w1J7e-0018Ai-2A for pgsql-general@arkaria.postgresql.org; Sat, 14 Mar 2026 07:09:19 +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 1w1J7e-0018AY-17 for pgsql-general@lists.postgresql.org; Sat, 14 Mar 2026 07:09:19 +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 1w1J7c-000000005Vq-2Rtl for pgsql-general@lists.postgresql.org; Sat, 14 Mar 2026 07:09:18 +0000 Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-79860421382so27319397b3.0 for ; Sat, 14 Mar 2026 00:09:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773472155; cv=none; d=google.com; s=arc-20240605; b=QlB2fpEQRAPh6qb5I3od9MPVt6NpxDlY0Sl/IevJkOS6JO6cbv8qaZ2Ms6GC0Nrgiv ioZMbew3uhJomUuQMGsyIZkphfRZ81DkYnqA/JOUoZLSEawKke4QmmOjjBAH/c/x0M4c +9GD2X7Hz2q3ywjYZ1hf5j8k2JKqjUevoZbUgT7XtYEpdQ0zV8xhPMzcjLkoE4YkbCNv zTNv/dYVNSVHR3aXYhaQ8dLbJUcTc/BcDhxxfA87kIHl5zpRNlLFay2BEU4G4YgvW6hc GyfkrphlKnOVN9RP6vf3Dz3i+hIvPuxNS3OIGzbgEufp3Cs8PID+igt/hEDgvG7GtFXL TWvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:from:mime-version:dkim-signature; bh=Cn1ne8zGV8edH1b5pNwuTkdnhbCGQljgh437JRdrRf8=; fh=2DoGC78b0mi8uZ4UY+9ocPF86GSVzeaJWqou/x907js=; b=da6/QJwFtMKrvJnWrm6H+v4R7A8mym42e3bM0zPBEgxlCtzBvU4bIpZ/K9ozqzl2cV X6v1jk++q78v33gzKZoFZDRF5vEPvaujJcKQ43PrdQhxHuIfc5O//D6enOsB2/jrlUzQ jDaPQl/DPOYaBytNfNtrd6WFblNvbZu5VW6Ucm0Fad2S0NC5wh3LkNB7nLcuT4vSpYFW tbvECR4y+/qjJP5dEdMA8HMN1RK8LFzpSknRtXtec4unb924q5QGfyv80aenL8HnPXcf /AdyiOv1ed1e7ClSKQTHxo3znqkctbMLqwAtizCIZsHMV5aFnaj9e1dYghnU0SfQgkp8 W17w==; 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=1773472155; x=1774076955; darn=lists.postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=Cn1ne8zGV8edH1b5pNwuTkdnhbCGQljgh437JRdrRf8=; b=h/I4+eHqMidff64O+t9EJzR0GzuOamB/xErAC1Ppb8c+k7I8ee1Q5acpUuXzj7dQsx U3+h7kNu+xMCQFSOK2AxzRrxz3j45jZPqR0ZdN12f7z0Drr/GZd4+G6ejUZP7HchrwYh BILSAagbtuDiKdmpp8TN6FnBe2ENNh/6Ue0FbPrt+JO1g69bDU7rRtmzYU5DrlJbPFUR p0ueOZ30E7IX+LKhxQbpVZxI/ys0co/OOrfhftdgkIw+9ceM4SSYj6Xs83CJfKC1pKQE xAM509xwwTrR8TLfkJqXMIFianos//eMq905gCXCjW6YsKu36rgrq8eJBWWxT/jDd6ir 0BrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773472155; x=1774076955; h=to:subject:message-id:date:from:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Cn1ne8zGV8edH1b5pNwuTkdnhbCGQljgh437JRdrRf8=; b=QSXwq46GDaoU7Hg+1PzVyDI7sROnV2US84LLQhaN6U8SszJF+rh92fXrYhz31a/AxN lI6kHp7v2za2HaLIGfGMY6fu0GqSfqIXWK7H2F8JlRaGFJ8cKBS47k9XkFnz4v28Z1Vb dpK3T2tH2DC7wDAW/RSIltavyVfElUqqLe7/M/TEjc84gU9QyJEdOFwZw4Sf/tPs5TH1 yXGI4LWqaD246Xf4V3tggqeDa4HyE9Xl+YivqdupbgaGc4f0DJOmdcuDr2G+fv03qypZ vEpO5c5cYE9PJbMrTfsGaun4z1dOQNup3QNAH/I1jH9kd+7ZjnuxMTzz8z2bIKYsWsMO yg5g== X-Gm-Message-State: AOJu0YwwPyJW8HDXJbBtOf9mgfySDXNwa9w9KSsDM/ZlLTC2cwY5MmgP VXmEiYsHy2Q2Dl3KQFAOuChpO4nhagdUv04P1tVfT5SnJIOsT7HTGVQZ2atc8R4fbcb/olmaI9V JrgvpKbtE/ATH7gbqzxMH4Kwtrz7bsb3rf0hf X-Gm-Gg: ATEYQzw+NBTiIwn2Vc/R8ncwSLPQDD3T6Y5O3QCq7EgCKfjvV+6f9jzwDAvlGiGZ+xY 7xhMWc2zdKAXqX9jN2p/4deMz7oX7pDsIrFKVHIF/u4SHNBPP+wPQo3B5X48qN8xD0lwgGfdCc9 ma+B1klRbQwtsCadrgctgwc/d7SX5L0yc5qJN/FwIK2VzD3kh9SvIeCt8fSEYtpDwlJu6oy+0aq 3eboWBxqAQaEld45DB7z+XO6ojqku8EYW5T9rklKyUBKAP2cL+nxAw8eWz0i8xsxMb/nq7A1aUa CV8OLVii80apLoOA9BVJbRj+Kj7GW5d7tNc1XmdDgpQpyWuzoubPdQ== X-Received: by 2002:a05:690c:698b:b0:797:acc1:5341 with SMTP id 00721157ae682-79a1c08ae97mr62710697b3.7.1773472154882; Sat, 14 Mar 2026 00:09:14 -0700 (PDT) MIME-Version: 1.0 From: Igor Korot Date: Sat, 14 Mar 2026 02:09:04 -0500 X-Gm-Features: AaiRm51HTbBHn0W9h_T57OPQGB8OkgH-uTbkumhR_nSY03yf8C4K4JA4bKtQmlc Message-ID: Subject: Does included columns part of the PK To: "pgsql-generallists.postgresql.org" Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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.