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 1lqyei-0008Sy-EB for pgsql-odbc@arkaria.postgresql.org; Wed, 09 Jun 2021 13:54:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lqyeg-0000eU-Id for pgsql-odbc@arkaria.postgresql.org; Wed, 09 Jun 2021 13:54:02 +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 1lqyeg-0000eM-1o for pgsql-odbc@lists.postgresql.org; Wed, 09 Jun 2021 13:54:02 +0000 Received: from mail-qb1can01on061a.outbound.protection.outlook.com ([2a01:111:f400:fe5c::61a] helo=CAN01-QB1-obe.outbound.protection.outlook.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqyed-0003yk-5M for pgsql-odbc@lists.postgresql.org; Wed, 09 Jun 2021 13:54:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lkTP8ZLkfA3WnbBDfK+xZL+mroWNiEB5T/EuEOj9AfCfjjRX2Tc35Ki3p/Hi8AU+KIPD7mR1ndNXLCFb4qvXufxlysdqA/uRf2kXlLSjjmca1OsjN3kjB9KpvYS+7EK/WC3L/ung+V5EDgAXt4NGCJ21K72VYFnUR/vvhuuPNVlCVwbN7OkFVfTcYGJ4v7jDYFfvLdlOPomcql622VjeHc64iz8QmPss37x74O1/LdN1dQ5wIHGA2nIok/dBwZ13EJ1sh7am0gRgEJttWdRstbQPiE3o7ko6L5rjYsNEj2/LiKAQZgrpONr6txJOEXbaUfilaM6oO3MCfyMQGM+8Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZXdCut7C7wJrSY6iLn7zx3ShRPPcOPwCQpjN7zxQ0Qc=; b=KfJT3SkNhSfqm3F2if76c0UD2ijbx7W1sL5Sz/6RJt4zPtSIFMpY17F8t5c7LhuTHhGGzT5LSFIEEuR8JvnIPpwfyT95UUl1QcRYFf5tsQfanOREyN+TYojViwsgn2Z/kOzqF7W20p9fp2TlQyLUWSUWAeB8aZ9FG0/zPdo+fggYHXrW22URTpvIlooYadTdaIqI9y7ef2VKFi8tsbdfgRxYYkMndkJdXZa7m+JMzucC+LRn5YUS35djtYv1EjIJ5eEIYVleA1UJksPkVUUjBekPBHwwOIpt4YVtrilwvJkunE9/Tshvmt73zh4J5DJ8hMrrjTl9PnctQVinO7TYQQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=axper.com; dmarc=pass action=none header.from=axper.com; dkim=pass header.d=axper.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axper.onmicrosoft.com; s=selector2-axper-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZXdCut7C7wJrSY6iLn7zx3ShRPPcOPwCQpjN7zxQ0Qc=; b=fmP8tHyWpd+YictoeXsn1V4GdCxZKqv03u9uqL+RJCykE63VEnRNkHaZMBfwGhA+JiNuXPg0CT/VQTpChQDAdhjC5b0MJqfJbbtQ/q09CKeJPNRGhjYBNCosSN41sM9zP8Cp8IB2wPI8Xu4pvELHozSDAacSHUx1gmFvq/ivAWg= Received: from YQXPR0101MB1301.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:16::16) by YQBPR0101MB1140.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:10::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4195.29; Wed, 9 Jun 2021 13:53:55 +0000 Received: from YQXPR0101MB1301.CANPRD01.PROD.OUTLOOK.COM ([fe80::69c4:aa49:17f1:9bd8]) by YQXPR0101MB1301.CANPRD01.PROD.OUTLOOK.COM ([fe80::69c4:aa49:17f1:9bd8%3]) with mapi id 15.20.4219.021; Wed, 9 Jun 2021 13:53:55 +0000 From: David Parenteau To: Paul van Rixel , "pgsql-odbc@lists.postgresql.org" Subject: Re: Data transfer from PG to SQL Server Thread-Topic: Data transfer from PG to SQL Server Thread-Index: AQHXXTN9pZ9VHyy2O0C2yTYe7cKGNasLsUK/ Date: Wed, 9 Jun 2021 13:53:55 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=axper.com; x-originating-ip: [208.88.110.10] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 680faf72-88af-44d1-6c04-08d92b4e05d0 x-ms-traffictypediagnostic: YQBPR0101MB1140: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: NmOTQCLmjx1vQpUxRfK6Z05K18HeJy5RtylXCfbiQmyFqEQvd4/9muOW56Jv6Le0H1C/o5v0Fcn3EYfsHTmPwn4oyzYUxHSVH55Vz2gYg3f9rx/qIgal+jO7vV8mey+vI0/jpKF9nXV+YwNgLENJO4UCeZ1bwQX1D8G7tiqfy4y2jOu1t5cD9S0dLHzaCIVEPtQ880SIQUzMLUm2J7h3sJ84cZrLj2M3n921OfM9LP4NUq4Fu7vaWRDJV9wA0W6nwL12bC+vwuT9q72H3KnNf3hg0/gORqebVz0I+Tu3u+IiK5dKf7YZ4XCL3onB53gDPM91buHDUNfgEroajeytmuRqtGS6hyeFgsJ3S0U32iIqSOz3oxSW+GQRVTNdDui2i1P6wNwyCAsZrOSeNkoK+cFEFMrdvEMFn//BRGwcpfus9JMYgLUNVvK6+AGb0EGz63SnfhbY7OIOP7IOuumNJP0fEgURqw5GFjBewtExru/KtppBgj4ayNpdc6hwM3ODVn2k+ClFDDB6EXUNZBuCVjALDgzrDgfAQMIu43t420mV65WBbrY8NVhYpaJ8/9ui3c7Vvy151o/v5eOYmuVKlBojqBYm8OC2fq6MrI6dhyA= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:YQXPR0101MB1301.CANPRD01.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(396003)(136003)(39830400003)(346002)(366004)(376002)(71200400001)(66476007)(66556008)(8676002)(52536014)(38100700002)(64756008)(66946007)(110136005)(122000001)(55016002)(478600001)(83380400001)(66446008)(26005)(9686003)(76116006)(5660300002)(186003)(316002)(86362001)(53546011)(6506007)(19627405001)(2906002)(8936002)(7696005)(33656002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata: =?iso-8859-1?Q?eQj9WiloLCVyc2OBses/IUP+cZzuGwr8M0NRRXFgdsP17NA8/5/QwO6JMh?= =?iso-8859-1?Q?E2ZIMEzimbZ5F2ANPrUqLP/Nwn2fnRd1NRD1M1Hkx4Xj9oAK+TP4sG9GNJ?= =?iso-8859-1?Q?BBPL+T2ewGvrphd3+2QZ4xP1fXlX94/MmSoCqm0ujiUn09s5hVZrYAFDlt?= =?iso-8859-1?Q?nZRZ/lQhZ47R4zRgNicicTFDZEDeD/4UqyOLQDMU8RIokMRQPpFSqsKWtA?= =?iso-8859-1?Q?jX8USXWqgoC4Tq7Xxdj80E/bJjpUgf7/pZYeXU0S0u/Wx3HFO/XOTE8fmg?= =?iso-8859-1?Q?88r7HCLvbTBJFEv1Wsm1FIA/aRMTuxGHxgKrFzMVZJXvngiPh+jty+NXws?= =?iso-8859-1?Q?15pdoO+syGUxysOJR7uI1b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TaLaLFLFwUnJEM/gBY52LsR51jiYG83SRQS/tc/ayizO7Ey6icfjAl+?= =?iso-8859-1?Q?cYbC1uqO4B/QHp+qwUbgrp/M4b1NPoSFLoW4K1ohRR0DXro=3D?= x-ms-exchange-transport-forked: True Content-Type: multipart/alternative; boundary="_000_YQXPR0101MB1301EA345FE85FA8929EE81CC2369YQXPR0101MB1301_" MIME-Version: 1.0 X-OriginatorOrg: axper.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: YQXPR0101MB1301.CANPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 680faf72-88af-44d1-6c04-08d92b4e05d0 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jun 2021 13:53:55.4014 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 25a5f507-f32a-4534-ba73-9466da238c43 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: bBDHS8C7RUKnMDQ3Oj7LOzmiwHY+ESQCofBUos/MumCg0srrFbsO4HgIkzP9eX9UefNq7rcF/shyEYh4WDOx0g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQBPR0101MB1140 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_YQXPR0101MB1301EA345FE85FA8929EE81CC2369YQXPR0101MB1301_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Maybe you could use a Scheduled Powershell script to get your data using Po= stGres ODBC and save them in SQL Server using the Bulk Copy object? Otherwi= se, getting data to json/csv files and then BULK INSERT these file sinto SQ= L Server might also be wuick based on my experience. Ex: $bc =3D new-object ("System.Data.SqlClient.SqlBulkCopy") $cn NOTE: On my side, to get my ODBC long calls to work I had to set the tcp ti= meout managed by pgbouncer to 120 instead of default. HTH. David ________________________________ From: Paul van Rixel Sent: Wednesday, June 9, 2021 8:48 AM To: pgsql-odbc@lists.postgresql.org Subject: Data transfer from PG to SQL Server Hi all, I'm looking for the best way to transfer data on a weekly basis to a SQL Se= rver Instance which will be the staging area for BI reporting. A SQL Server= Linked Server configuration is because of security issues not allowed so n= ow I need some help! What I did previously was installing the Postgres ODBC Driver 12_02 versio= n, configuration is ok because a test is successful. So next step was to c= onfigure a linked server and in that way I can see the tables. To get the d= ata from straigtforwarded tables without JSON or XML columns I used openque= ry from SQL Server. That works for 80% of the tables. I also see in the Pos= tgresql logfiles that I'm connected and read that table. Large tables (> 3GB) however did not transfer! Also tried with Export/Import wizard from SQL Server Managememnt Studio but= also from SSIS. Both failed. So my simple question is how to transfer Postgresql data/tables to SQL Serv= er without Linked Server or other paid tools like pgOledb? I could not find= answer so that's why I'm here! Any help would be appreciated! Best regards, Paul van Rixel DBA --_000_YQXPR0101MB1301EA345FE85FA8929EE81CC2369YQXPR0101MB1301_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Maybe you could use a Scheduled Powershell script to get your data using Po= stGres ODBC and save them in SQL Server using the Bulk Copy object? Otherwi= se, getting data to json/csv files and then BULK INSERT these file sinto SQ= L Server might also be wuick based on my experience.

Ex: 
$bc =3D new-object ("System.Data.SqlClient.SqlBulkCopy") $cn

NOTE: On my side, to get my ODBC long calls to work I had to set the <= span style=3D"box-sizing:border-box;font-family:"Segoe UI", syste= m-ui, "Apple Color Emoji", "Segoe UI Emoji", sans-serif= ;font-size:14px">tcp timeout managed by pgbouncer to 120 instead of default= .
<= font face=3D"Segoe UI, system-ui, Apple Color Emoji, Segoe UI Emoji, sans-s= erif">
HTH.

David


From: Paul van Rixel <= pvanrixel@gmail.com>
Sent: Wednesday, June 9, 2021 8:48 AM
To: pgsql-odbc@lists.postgresql.org <pgsql-odbc@lists.postgresql.= org>
Subject: Data transfer from PG to SQL Server
 
Hi all,

I'm looking for the best way to transfer data on a weekly basis to a S= QL Server Instance which will be the staging area for BI reporting. A SQL S= erver Linked Server configuration is because of security issues not allowed= so now I need some help!

What I did previously was installing the  Postgres ODBC Driver 12= _02 version, configuration is ok because a test is successful.  So nex= t step was to configure a linked server and in that way I can see the table= s. To get the data from straigtforwarded tables without JSON or XML columns I used openquery from SQL Server. That works f= or 80% of the tables. I also see in the Postgresql logfiles that I'm connec= ted and read that table.
Large tables (> 3GB) however did not transfer!
Also tried with Export/Import wizard from SQL Server Managememnt Studi= o but also from SSIS. Both failed.

So my simple question is how to transfer Postgresql data/tables to SQL= Server without Linked Server or other paid tools like pgOledb? I could not= find answer so that's why I'm here!

Any help would be appreciated!

Best regards,

Paul van Rixel
DBA
--_000_YQXPR0101MB1301EA345FE85FA8929EE81CC2369YQXPR0101MB1301_--