Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mG3x3-00042f-JI for pgsql-odbc@arkaria.postgresql.org; Tue, 17 Aug 2021 18:36:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mG3x2-0002uJ-Hf for pgsql-odbc@arkaria.postgresql.org; Tue, 17 Aug 2021 18:36:40 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mG3x2-0002u8-9v for pgsql-odbc@lists.postgresql.org; Tue, 17 Aug 2021 18:36:40 +0000 Received: from mail-ua1-x92f.google.com ([2607:f8b0:4864:20::92f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mG3x0-0007HK-1c for pgsql-odbc@lists.postgresql.org; Tue, 17 Aug 2021 18:36:39 +0000 Received: by mail-ua1-x92f.google.com with SMTP id x19so9398345uat.2 for ; Tue, 17 Aug 2021 11:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=7qZnzZIQexRN5+zerQMqSzHZW4Uj5coYQZG1+jA9NRk=; b=h2MI94XEVuuc3Nb0xaWxBTU9dodO6ZdzYd3TysLNzeDqLe56yu5g3cf5qIY1SZLTgc CVbLjpRniHhpxTXS+IXiQfRkbPpcazOa9UiyV5ecOD9DwFKbCgUVooxdqZVa/9e/gVZ7 TSi51vaerWKIjLSba+S7flckCtfu5DEGpjsN5hXlVVBdEvrs753mHKb0Bjm9DHsDbzPM 1ek3luwRg0M34M5Vzs8XkqjEfQEyRcEN0ySzbcbn+hyEUpS5o7l4Q67noZ4bTA/62r/R t2LeNu6Uin3XhVUt03OZ8oCKYRQAp93TV22j7Wmc9roJCiwkiOxNPp8ISGzJYdhDXCgs 0z3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=7qZnzZIQexRN5+zerQMqSzHZW4Uj5coYQZG1+jA9NRk=; b=N6t3GCYIz+4JteAVBs1FgT2SGr5JiVjRG9yOI/ptRCILh29L+1wN1fEgbKvutsiu0k IPKny4wK7smnynpbOfAKLY7nuShVOlTr61T+cLRElPbpcDZxIciZkUnH5zZSLPdvixA6 KQh00nzjvYyexljBjZlyeOLpgMW8M8vuWrI8YIeV/R8IGQ6uaz90pp+wvUoaSPUP71cI CyDMrP58BeSSAwgNc8VIh3Oyc/Tqtzl0OEkR2T1L9oehkUOI5h6hcJU1JglBGTOo4+FJ FuXIlo+VoDSarohnLGPW+hzIcOTRaYvM4mfumFk4zQM3iB7fLs0r91xZ9YuDwBq3oHyi L2Kw== X-Gm-Message-State: AOAM532YmzGWzajx+Mak7tllUIFI+gTZvDrV+KNali1pTnv4kHuZfhTg 84TtZhU4qgQyqdCTUfM3wswinhMewSCY4Ufje8EHZwPtD4u3PA== X-Google-Smtp-Source: ABdhPJxByZXPvGntkDsTdXRPHrsc/dzrIGuq2MaFhp6zl0H+TiwHs//MSD5JgOmQT4w7p4wUAsY2VF+DvfhqKMOO/74= X-Received: by 2002:ab0:7305:: with SMTP id v5mr3732085uao.47.1629225396640; Tue, 17 Aug 2021 11:36:36 -0700 (PDT) MIME-Version: 1.0 From: Dulanic Date: Tue, 17 Aug 2021 13:36:01 -0500 Message-ID: Subject: SSMS ODBC Linked Server Issue To: pgsql-odbc@lists.postgresql.org Content-Type: multipart/alternative; boundary="00000000000006a0cb05c9c59933" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000006a0cb05c9c59933 Content-Type: text/plain; charset="UTF-8" Hello, I have reviewed a few different examples of SQL Server/Postgres ODBC linked server connections. I have gotten some to work, but some tables refuse. This is the query I am attempting to run and the methods I have tried so far. select * from POSTGRES.teslamate.[public].addresses and select * from openquery(POSTGRES,' select * from public.addresses ') but both error out /w this error: Msg 7356, Level 16, State 1, Line 1 The OLE DB provider "MSDASQL" for linked server "POSTGRES" supplied inconsistent metadata for a column. The column "display_name" (compile-time ordinal 2) of object " select * from public.addresses " was reported to have a "LENGTH" of 512 at compile time and 174 at run time. It seems like it is saying it's a 512 length field, and it is. It is a character varying(512). However, when the query runs, it comes back saying it's a 174 length field which is the current max length. These are the settings I am using for ODBC, though I have tried every possible variation of these that I could find to solve. These are my options in SSMS: https://dulanic.com/img/ssms.png These are my options in ODBC. https://dulanic.com/img/odbc.png https://dulanic.com/img/odbc1.png https://dulanic.com/img/odbc2.png --00000000000006a0cb05c9c59933 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

I have reviewed a few different = examples of SQL Server/Postgres ODBC linked server connections. I have gott= en some to work, but some tables refuse. This is the query I am attempting = to run and the methods I have tried so far.

select= *
from POSTGRES.teslamate.[public].addresses

and

=C2=A0select * from openquery(POSTGRES,'= ;
select *
from public.addresses
')

but b= oth error out /w this error:

Msg 7356, Level 16, S= tate 1, Line 1
The OLE DB provider "MSDASQL" for linked server= "POSTGRES" supplied inconsistent metadata for a column. The colu= mn "display_name" (compile-time ordinal 2) of object "
se= lect *
from public.addresses
" was reported to have a "LENG= TH" of 512 at compile time and 174 at run time. It seems like it is sa= ying it's a 512 length field, and it is. It is a=C2=A0character varying= (512). However, when the query runs, it comes back saying it's a 174 le= ngth field which is the current max length. These are the settings=C2=A0I a= m using for ODBC, though I have tried every possible=C2=A0variation of thes= e that I could find to solve.

These are my opt= ions in SSMS:

These are my op= tions in ODBC.





--00000000000006a0cb05c9c59933--