I have a table which is a direct copy of the table on the MS SQL Server (create l_table as select * from fdw_table).
When the data is inserted into the PG table, the fields that have a int4 type and has a value of NULL, will be inserted with a 0 value. The local PG table does not have a default value defined.
Details:
PG Version: PostgreSQL 11.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit
MSSql: Microsoft SQL Server 2017 (RTM-CU13) (KB4466404) - 14.0.3048.4 (X64)
Nov 30 2018 12:57:58
Copyright (C) 2017 Microsoft Corporation
Standard Edition (64-bit) on Windows Server 2019 Datacenter 10.0 (Build 17763: ) (Hypervisor)
Installed FDW.
Installed Packages
Name : freetds
Arch : x86_64
Version : 1.1.11
Release : 1.el7
Size : 1.5 M
Repo : installed
From repo : epel
Summary : Implementation of the TDS (Tabular DataStream) protocol
URL : http://www.freetds.org/
License : LGPLv2+ and GPLv2+
Description : FreeTDS is a project to document and implement the TDS (Tabular
: DataStream) protocol. TDS is used by Sybase(TM) and Microsoft(TM) for
: client to database server communications. FreeTDS includes call
: level interfaces for DB-Lib, CT-Lib, and ODBC.
I have a table which is a direct copy of the table on the MS SQL Server (create l_table as select * from fdw_table).
When the data is inserted into the PG table, the fields that have a int4 type and has a value of NULL, will be inserted with a 0 value. The local PG table does not have a default value defined.
Details: PG Version: PostgreSQL 11.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit MSSql: Microsoft SQL Server 2017 (RTM-CU13) (KB4466404) - 14.0.3048.4 (X64) Nov 30 2018 12:57:58 Copyright (C) 2017 Microsoft Corporation Standard Edition (64-bit) on Windows Server 2019 Datacenter 10.0 (Build 17763: ) (Hypervisor)
Installed FDW.
Installed Packages Name : freetds Arch : x86_64 Version : 1.1.11 Release : 1.el7 Size : 1.5 M Repo : installed From repo : epel Summary : Implementation of the TDS (Tabular DataStream) protocol URL : http://www.freetds.org/ License : LGPLv2+ and GPLv2+ Description : FreeTDS is a project to document and implement the TDS (Tabular : DataStream) protocol. TDS is used by Sybase(TM) and Microsoft(TM) for : client to database server communications. FreeTDS includes call : level interfaces for DB-Lib, CT-Lib, and ODBC.