Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

Database replication from SQL Server 2000 to PostgreSQL

$
0
0

We are SQL Server users and recently we have one database on PostgreSQL. For consistency purpose we are replication database on SQL Server 2000 to other database on SQL Server 2000 and now we would also need to replicate it to the database on PostgreSQL. We were able to do that using ODBC and Linked Server. We created an ODBC DSN for database on PostgreSQL and using that DSN we created a Linked Server on SQL Server. We were able to replicate tables from SQL Server database to that linked server and hence to PostgreSQL database successfully. Now the issue faced is while replication, the datatype bit, numeric(12,2) and decimal(12,2) are converted to character(1), character(40) and character(40) respectively. Is there any solution on how to retain those data types in PostgreSQL database ? I mean the bit should become boolean, and numeric and decimal data type should remain as it is in the replicated table of postgresql. We are using PostgreSQL 9.x

SQL Server table,

CREATE TABLE tmtbl 
(
    id int IDENTITY (1, 1) NOT NULL PRIMARY KEY,
    Code varchar(15),
    booleancol bit,
    numericcol numeric(10, 2),
    decimalcol decimal(10, 2)
) 

after being replicated to PostgreSQL it becomes,

CREATE TABLE tmtbl
(
  id integer,
  "Code" character varying(15),
  booleancol character(1),
  numericcol character(40),
  decimalcol character(40),
)

Thank you very much.


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>