Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1smDsL-00491O-Hc for pgsql-admin@arkaria.postgresql.org; Thu, 05 Sep 2024 14:54:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1smDsK-00BulQ-5Q for pgsql-admin@arkaria.postgresql.org; Thu, 05 Sep 2024 14:54:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1smDsJ-00Buh0-Mz for pgsql-admin@lists.postgresql.org; Thu, 05 Sep 2024 14:54:20 +0000 Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1smDsE-000IfO-3R for pgsql-admin@lists.postgresql.org; Thu, 05 Sep 2024 14:54:19 +0000 Received: by mail-lf1-x12c.google.com with SMTP id 2adb3069b0e04-535be093a43so1128356e87.3 for ; Thu, 05 Sep 2024 07:54:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1725548053; x=1726152853; darn=lists.postgresql.org; h=in-reply-to:from:content-language:references:to:subject:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=8BkR3V4gnA2nT18guMbNSaiMaEZcMvVi+r6r2Tu1d+c=; b=J4WM6MPUOLkaxI7cB2cRsZ3DewVGBa/X2ijLcdnUFZxOY0ilKrMpn8l1gDq0lfNJsH JC8Cd4KmK3IVWw3Z4OmAWe3WloAigQDoZElrpWqdewlQignlqRPZbzHLYTdtyfMVbxyz FQood0oawDR/P9sDWNEPUFdCWW7cewJK0q5fEUpRn9y+Hoh2IG6PZxNbZh15NSPQTGr5 lTYKT3NtWbYYLCmZOwXT2QOysknt8c2V9pn70B7SnfKdK7yFtnWltXmhA799P2b/DT28 fY/7m+x7uh5u9ToBCEUO5K7T1YQ8ZQNvBm8p8pSmgne6YBMulI1P5+4qK7/IvDGXHaFq OJ1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725548053; x=1726152853; h=in-reply-to:from:content-language:references:to:subject:user-agent :mime-version:date:message-id:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=8BkR3V4gnA2nT18guMbNSaiMaEZcMvVi+r6r2Tu1d+c=; b=rRBvxMMc5cUwVQi2eMKXO0NLgdONb0dTFrFs29FTHoBzxd/+r05MS+ULodrp+Hdzxs M65UJ+j1aMCky7XA8yQ0kQ7Ix5aebtEX5K7if5HOzORpmfFkMrZmTtYdCQv9jMdrr0uL 6/yv9EqF/EFQqB6AMwsfvwGu01Q387WdbajIpPcL4n2LKtv60ZiiimujreOypnLiKxqV 8PTsw/xaumXjgT90I+L/1KhsGaLvujWHRryxSR9Ek69ZujNzZBEJnS4KJzqw0pJDs65T jolZvEkJeYA3XMCHkY5DmWkDReQcA8UU1DXILleGp9M7dkOzxtcRcNjU3mmYetEpqr9j Ozig== X-Gm-Message-State: AOJu0YwAxf/ZCxsHqPhk27TRhXO5Nn9y9jtilz8gCPxbrUQ98Trd0/uO OVrZXl3br3LofARlUsyKNVIsQkcMNudBtUwYCaVu5CXuCqzth7CWCAZkDg== X-Google-Smtp-Source: AGHT+IFrY8+ZeswhSmdbVaax9ikXzSYh6+3bnyRP2r2/hvmb0wQbCo7NTA7R3DE/pA7FYdLBjelxSw== X-Received: by 2002:a05:6512:3d17:b0:535:6a4d:ed74 with SMTP id 2adb3069b0e04-5356a4def44mr2846094e87.51.1725548052582; Thu, 05 Sep 2024 07:54:12 -0700 (PDT) Received: from [192.168.1.81] (87-57-240-99-static.dk.customer.tdc.net. [87.57.240.99]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5354084ca10sm2620343e87.246.2024.09.05.07.54.11 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Sep 2024 07:54:11 -0700 (PDT) Content-Type: multipart/alternative; boundary="------------7J29NWMUeRMdF9InHovQQkeG" Message-ID: <2e6fb4e8-2854-4eea-96ba-af2e5212b4e1@gmail.com> Date: Thu, 5 Sep 2024 16:56:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Incremental load from SQL server DB to postgressql To: pgsql-admin@lists.postgresql.org References: <7D5A40F7-855D-4E14-9866-A6C22CA79327@jakobs.com> Content-Language: en-GB, da From: Bo Victor Thomsen In-Reply-To: <7D5A40F7-855D-4E14-9866-A6C22CA79327@jakobs.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------7J29NWMUeRMdF9InHovQQkeG Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit You could use the the /*ogc_fdw*/ foreign data wrapper. It's a data wrapper for accessing spatial data using the GDAL library. But it works just fine with non-spatial data too, including MS-SqlServer. And it's well maintained. Med venlig hilsen / Best regards Bo Victor Thomsen On 05-09-2024 16:01, Holger Jakobs wrote: > You could try to use BCP.exe for exporting from MS SQL to a flat file > per table. Load into PG SQL Server with COPY or \copy (psql). > > Using the TSQL foreign data wrapper to pull data over is another > option. This FDW isn't very well maintained, though. > > Regards > Holger > > -- > Holger Jakobs, Bergisch Gladbach > Tel. +49 178 9759012 > > > Am 5. September 2024 15:54:31 MESZ schrieb Sabyasachi Mukherjee > : > > Hello All, > > I have to implement an incremental load from a SQL server DB to a > postgresql DB. I would prefer it to be pull from postgres. > SSIS is not the preferred option. Can you please advise about the > possibilities? > > Sabyasachi Mukherjee > --------------7J29NWMUeRMdF9InHovQQkeG Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

You could use the the ogc_fdw foreign data wrapper. 


It's a data wrapper for accessing spatial data using the GDAL library. But it works just fine with non-spatial data too, including MS-SqlServer. And it's well maintained.


Med venlig hilsen / Best regards

Bo Victor Thomsen
On 05-09-2024 16:01, Holger Jakobs wrote:
You could try to use BCP.exe for exporting from MS SQL to a flat file per table. Load into PG SQL Server with COPY or \copy (psql).

Using the TSQL foreign data wrapper to pull data over is another option. This FDW isn't very well maintained, though.

Regards
Holger

--
Holger Jakobs, Bergisch Gladbach
Tel. +49 178 9759012


Am 5. September 2024 15:54:31 MESZ schrieb Sabyasachi Mukherjee <mukherjee.sabyasachi@outlook.com>:
Hello All,

I have to implement an incremental load from a SQL server DB to a postgresql DB. I would prefer it to be pull from postgres.
SSIS is not the preferred option. Can you please advise about the possibilities?

Sabyasachi Mukherjee
--------------7J29NWMUeRMdF9InHovQQkeG--