Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gA0Aw-0007zt-N6 for pgsql-general@arkaria.postgresql.org; Tue, 09 Oct 2018 22:08:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gA0Av-0002Pg-3Z for pgsql-general@arkaria.postgresql.org; Tue, 09 Oct 2018 22:08:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gA0Au-0002PY-04 for pgsql-general@lists.postgresql.org; Tue, 09 Oct 2018 22:08:20 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gA0Aq-0007rd-KM for pgsql-general@lists.postgresql.org; Tue, 09 Oct 2018 22:08:19 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id EEFB221EEB; Tue, 9 Oct 2018 18:08:14 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 09 Oct 2018 18:08:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=I a56XtaXE33BFQjci+18w1GQnYlWjqEn9BGg/x17m9Q=; b=36xlvWtkslAyXcCR0 9vP9fdsQEpQ8z3FqJZkFhociUwlJRVJrMVFZHrJ1F/nVhJCCBgc+RXt5CO6oA21S DYgm88QRPjid8gni2C2nTRAvFMbmLzAun+3ywGC7ML3WGQmKFL2JQlEZtKAYyceP a5IZUMsQnbAWK3ot6lxLNlbRSu98S5Au7f2Gi5QRzCvmBd93I4a9WNGaWog9vpJP LX4X1wUQC3RWyVxxwdtdI+6knJDF+fznf5/nTotd7D3HycDJKE4FiX4qnFpRWI+g v1tsRvasTAksUnvFEmBvccp0srpNtY1ZiRajXppD6v4UKoqAPhKR2nI38FpNWyKU hfVSw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=Ia56XtaXE33BFQjci+18w1GQnYlWjqEn9BGg/x17m 9Q=; b=wd8uA5y9LNnGQqlt1kQ0ydCqFybplSacnAID10WhGdu7S4yKGaCatIuVU ExgM619Rn7zJDw//nSNdh+R1iqnc/o73Ap2eSMNPQVGqQkAOWuCcLZEf1vZALQoj J//4Q8sX4JpzkaTYz1fkeJq/YPUxPoxlP0zw4P5e37+bAhJdk/Oqqcb9txW3/qPh A4SUZNQZWI4Jb0nxBaAZ4anaZlQTMx65XAfckG//qi+us5RWMkEq7WxgzwjgOqjU 3cY5R6i9TWmPHvs3+B++mZd/+m5B4YIrllaJK87H5/g6it4N/3Flgyu0ApVOJi2F 22TH+L/tqhqWXZxMxg57yHqhzMmeA== X-ME-Sender: X-ME-Proxy: Received: from ranger.suse (c-73-239-117-238.hsd1.wa.comcast.net [73.239.117.238]) by mail.messagingengine.com (Postfix) with ESMTPA id 18C5BE461F; Tue, 9 Oct 2018 18:08:14 -0400 (EDT) Subject: Re: tds_fdw binary column To: =?UTF-8?B?QWxlxaEgWmVsZW7DvQ==?= , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: <3493607d-43aa-f4a9-b669-09ec91c67ff3@aklaver.com> Date: Tue, 9 Oct 2018 15:08:12 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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