pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Aleš Zelený <zeleny.ales@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: tds_fdw binary column
Date: Tue, 9 Oct 2018 15:08:12 -0700
Message-ID: <3493607d-43aa-f4a9-b669-09ec91c67ff3@aklaver.com> (raw)
In-Reply-To: <CAODqTUYTADtKgXMA-Wj9iZX8Z2t8jYR4xicNhquuY=NWyKZdFA@mail.gmail.com>
References: <CAODqTUYTADtKgXMA-Wj9iZX8Z2t8jYR4xicNhquuY=NWyKZdFA@mail.gmail.com>

On 10/9/18 12:07 PM, Aleš Zelený wrote:
> Hello,
> 
> I've an issue with foreign table using tds_fdw from PostgreSQL 10 to 
> Sybase ASE 15.7.
> 
> The issue is, that primary key, which I have to use for my predicate is 
> in Sybase data type binary.
> 
> Foreign table maps ID column from Sybase binary to PostgreSQL BYTEA.
> 
> Simple select is smooth:
> [local]:5432 postgres@postgres:7650
> =# select branch_id from ase.tds_tbl limit 1;
> NOTICE:  tds_fdw: Query executed correctly
> NOTICE:  tds_fdw: Getting results
> ┌────────────────────┐
> │     branch_id      │
> ├────────────────────┤
> │ \x000246000944242d │
> └────────────────────┘
> (1 row)
> 
> Whereas select using the ID fails:
> 
> [local]:5432 postgres@postgres:7650
> =# select * from ase. tds_tbl where branch_id = 
> E'\\x000246000944242d'::bytea;
> ERROR:  DB-Library error: DB #: 102, DB Msg: General SQL Server error: 
> Check messages from the SQL Server, OS #: -1, OS Msg: , Level: 15
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Have you done the above, look at the error log for the server?

> Time: 0.213 ms
> 
> Thanks for any hints.


> Kind regards Ales Zeleny


-- 
Adrian Klaver
adrian.klaver@aklaver.com




view thread (6+ messages)  latest in thread

Message-ID: <3493607d-43aa-f4a9-b669-09ec91c67ff3@aklaver.com>
Permalink:  ../3493607d-43aa-f4a9-b669-09ec91c67ff3@aklaver.com/
Also on:    postgresql.org/message-id/3493607d-43aa-f4a9-b669-09ec91c67ff3@aklaver.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, zeleny.ales@gmail.com
  Subject: Re: tds_fdw binary column
  In-Reply-To: <3493607d-43aa-f4a9-b669-09ec91c67ff3@aklaver.com>
  References: <CAODqTUYTADtKgXMA-Wj9iZX8Z2t8jYR4xicNhquuY=NWyKZdFA@mail.gmail.com> <3493607d-43aa-f4a9-b669-09ec91c67ff3@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox