Re: tds_fdw binary column

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Aleš Zelený <zeleny(dot)ales(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: tds_fdw binary column
Date: 2018-10-09 22:08:12
Message-ID: 3493607d-43aa-f4a9-b669-09ec91c67ff3@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)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(at)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(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Malik Rumi 2018-10-09 22:25:52 Re: FTS trigger works 1 at a time, but fails with bulk insert script
Previous Message Christoph Moench-Tegeder 2018-10-09 20:56:03 Re: Privilege mess?