Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZJkuK-0003AH-81 for pgsql-odbc@arkaria.postgresql.org; Mon, 27 Jul 2015 16:05:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZJkuJ-0007ar-PY for pgsql-odbc@arkaria.postgresql.org; Mon, 27 Jul 2015 16:05:39 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZJktw-0006f7-Fj for pgsql-odbc@postgresql.org; Mon, 27 Jul 2015 16:05:16 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZJktt-000101-Qy for pgsql-odbc@postgresql.org; Mon, 27 Jul 2015 16:05:15 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 9D1DE20E6B for ; Mon, 27 Jul 2015 12:05:12 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Mon, 27 Jul 2015 12:05:12 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=hJGqo2UIQkoTw56y6ko0fWPgLj4=; b=hSf/f5 /0amkLYB1q2kD2AMM9gaqGNMtn5lzSJ9WyoE7RMJzcsZLJanxjzsr/mNRC/MxQUR MpSHaa6zN9RWdbj56x5rusFm+sub3fiuKFr8TDC96oxmRwK5LaXnTDFzZzg4Gx+/ ETTpNmMkUKvCd1/IClET0IH3I3j8SJqKQAxWc= DKIM-Signature: v=1; a=rsa-sha1; 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-sasl-enc:x-sasl-enc; s=smtpout; bh=hJGqo2UIQkoTw56 y6ko0fWPgLj4=; b=n4kjaUbogS6JVG+lhaLmxynu3HRYmDPszz5p+xH5eRMvb0g Ha2Temvd2beWl/+RpNgLa6qW/zsnfxqHftzht38C7fD9Iq6143R4VGBfApUDBdOX NQpAWt+M6pvjsoch3ZbLcAGKtWzm01iWhHUaKl97muk5sHdstlq0H28OAsxg= X-Sasl-enc: Ur71vRkh1KguUYmipmUf1nmW5NEnwA0P7XPy7OsAe5xe 1438013112 Received: from [192.168.1.2] (97-113-26-19.tukw.qwest.net [97.113.26.19]) by mail.messagingengine.com (Postfix) with ESMTPA id 21FB268015B; Mon, 27 Jul 2015 12:05:12 -0400 (EDT) Subject: Re: PSQLODBC.DLL - The (maximum) expected data length is 8000, while the returned data length is 9606. To: "Jens Sorensen (Intuii)" , pgsql-odbc@postgresql.org References: <4854fc01d0c6cb$fc0c0010$f4240030$@Intuii.com> From: Adrian Klaver Message-ID: <55B656AD.6020800@aklaver.com> Date: Mon, 27 Jul 2015 09:05:01 -0700 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <4854fc01d0c6cb$fc0c0010$f4240030$@Intuii.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org On 07/25/2015 04:20 AM, Jens Sorensen (Intuii) wrote: > Hello, > > I’m stuck. > > I’m trying to import data from PostgreSQL running on an Untangle > appliance (Untangle.com) to SQL Server, but can’t seem to overcome an > issue with the following error: > > *Msg 7347, Level 16, State 1, Line 7* > > *OLE DB provider 'MSDASQL' for linked server '(null)' returned data that > does not match expected data length for column '[MSDASQL].uri'. The > (maximum) expected data length is 8000, while the returned data length > is 9606.* So what is the size limit, if any, in the SQL Server field. > > Even after increasing the MaxLongVarcharSize as in the following select > statement, I still get this same error with the value of 8000. > > select * from openrowset('MSDASQL', > 'Dsn=PostgreSQL35W;MaxLongVarcharSize=16000;', 'select * from > reports.http_events') > > I’ve also tried this one: > > select * from openrowset('MSDASQL', 'Driver=PostgreSQL > Unicode(x64);uid=postgres;Server=10.5.55.1;port=5432;database=uvm;MaxLongVarChar=16000;', > > > ‘SELECT event_id > > ,time_stamp > > ,session_id > > ,client_intf > > ,server_intf > > ,c_client_addr > > ,s_client_addr > > ,c_server_addr > > ,s_server_addr > > ,c_client_port > > ,s_client_port > > ,c_server_port > > ,s_server_port > > ,policy_id > > ,username > > ,hostname > > ,request_id > > ,method > > ,uri > > ,host > > ,c2s_content_length > > ,s2c_content_length > > ,s2c_content_type > > ,adblocker_blocked > > ,adblocker_cookie_ident > > ,adblocker_action > > ,webfilter_reason > > ,webfilter_category > > ,webfilter_blocked > > ,webfilter_flagged > > ,sitefilter_reason > > ,sitefilter_category > > ,sitefilter_blocked > > ,sitefilter_flagged > > ,clam_clean > > ,clam_name > > ,virusblocker_clean > > ,virusblocker_name > > from reports.http_events') > > From ODBC setup: > > From a “pg_dump” of schema: > > -- > > -- Name: http_events; Type: TABLE; Schema: reports; Owner: postgres; > Tablespace: > > -- > > CREATE TABLE http_events ( > > event_id bigint NOT NULL, > > time_stamp timestamp without time zone, > > session_id bigint, > > client_intf smallint, > > server_intf smallint, > > c_client_addr inet, > > s_client_addr inet, > > c_server_addr inet, > > s_server_addr inet, > > c_client_port integer, > > s_client_port integer, > > c_server_port integer, > > s_server_port integer, > > policy_id bigint, > > username text, > > hostname text, > > request_id bigint, > > method character(1), > > uri text, > > host text, > > c2s_content_length bigint, > > s2c_content_length bigint, > > s2c_content_type text, > > adblocker_blocked boolean, > > adblocker_cookie_ident text, > > adblocker_action character(1), > > webfilter_reason character(1), > > webfilter_category text, > > webfilter_blocked boolean, > > webfilter_flagged boolean, > > sitefilter_reason character(1), > > sitefilter_category text, > > sitefilter_blocked boolean, > > sitefilter_flagged boolean, > > clam_clean boolean, > > clam_name text, > > virusblocker_clean boolean, > > virusblocker_name text > > ); > > Any advise appreciated! > > Jens > -- Adrian Klaver adrian.klaver@aklaver.com -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc