How to Transfer SQL Server to PostgreSQL in Four Steps
Step 1: Connect to SQL Server
Server, port (1433), database, and either SQL Server authentication or Windows authentication — a Named Instance and an SSH tunnel are both supported.
Step 2: Connect to PostgreSQL
Host, port (5432), database, schema, user and password. The same form works for a local server, RDS, Aurora and Azure Database for PostgreSQL.
Eight Operations, Three Load Modes
Eight operations, one dialog. Each one is a mode of the same session — the screenshot beside it is what that mode looks like:
Migrate the whole database
Every SQL Server table becomes a PostgreSQL table in one run, andIDENTITY becomes an identity column rather than a plain integer.
📷
Copy one table
The target table is built from the SQL Server definition; nothing else in the database is touched, and the rest of the schema stays as it was. 📷Copy a query result
Filters and joins run on the SQL Server side and only the returned rows are written — a derived column belongs in theSELECT.
📷
Batch copy many tables
Each table maps to its own target table, replace or append is decided per table, and the whole batch runs from one session you can save. 📷Merge similar tables into one
One table per month or per branch becomes a single PostgreSQL table; columns are matched by name and rows appended in the order you pick. 📷Convert SQL Server types
nvarchar to text, datetime2 to timestamp, bit to boolean, uniqueidentifier to uuid, varbinary to bytea.
📷
Keep both sides in step
A full sync replaces the contents; an incremental sync upserts on the key you name, so a nightly run writes only the rows that changed. 📷Schedule it
The saved session runs from Task Scheduler, cron or launchd, or straight fromDBCopier schedule --daily=02:30 --install.
📷
Three load modes, plus one that is often what a “schema migration” search actually means:
- Replace — the target table is truncated and refilled. Right for a lookup table rebuilt from the source.
- Append — rows are added. Right when the source itself only holds new rows.
- Incremental upsert — rows are matched on the key you name and only changed ones are written:
sync table data from mssql to postgresrun on a timer, not a change stream. - Schema only — the DDL is generated and the data is skipped, for the “migrate sql server schema to postgresql” case where the tables are filled by the application afterwards.
SQL Server to PostgreSQL — Type Mapping
What the generated DDL does by default; every row can be overridden per column:
| SQL Server | PostgreSQL |
|---|---|
| int / bigint / smallint | integer / bigint / smallint |
| tinyint (0–255) | smallint — PostgreSQL has no unsigned byte |
| bit | boolean |
| decimal(p,s) / numeric(p,s) | numeric(p,s) |
| float / real | double precision / real |
| money | numeric(19,4) — money is not a type in PostgreSQL |
| nvarchar(n) / varchar(n) | varchar(n) — or text when n is max |
| char(n) / nchar(n) | char(n) |
| text / ntext | text |
| date | date |
| datetime / datetime2 | timestamp |
| datetimeoffset | timestamptz |
| time | time |
| uniqueidentifier | uuid |
| varbinary(max) / image | bytea |
| xml | xml |
| rowversion / timestamp | bytea — it is a version stamp, not a time |
| IDENTITY | generated identity column, keeping the seed and increment |
Managed Target Requirements
The copy is the same; the target's rules are not. All three managed services bring the following, and each one fails in a way that looks like a bad password:
- SSL is required — a plain connection is refused, so enable SSL on the PostgreSQL side of the session.
- No superuser — the account cannot create extensions or reassign ownership; the schema it writes into has to already exist and be writable.
- An IP allowlist — Aurora security groups, Azure firewall rules and RDS VPC settings all block the first connection from an unknown address.
- Aurora Serverless and Azure Burstable tiers can pause or throttle, which turns a large copy into a timeout rather than an error.
What This Tool Does Not Convert
It moves tables, views' underlying data and query results — not the code around them. Knowing the line is worth more than a failed run:
- Stored procedures, functions and triggers — T-SQL is not PL/pgSQL. Rewriting them is a code translation job (SSMA and friends), and no table copy does it for you.
- Views, jobs, SSIS packages and logins — not data, so not copied. A view can be recreated on the target as a query.
- Collation and case sensitivity — SQL Server databases are often case-insensitive, PostgreSQL is case-sensitive by its own rules; a
CITEXTextension or a normalised column is a decision for the target, not a mapping option. - Identity values in an existing table — if the target table already exists, the column is written as an ordinary value; only a generated table keeps identity semantics.
Common Pitfalls when Migrating SQL Server to PostgreSQL
money,uniqueidentifier,hierarchyidandrowversionneed an explicit mapping. They have no same-name equivalent, and the default guess is not always what the application expects — especiallyrowversion, which is a version stamp, not a timestamp.tinyintis unsigned in SQL Server and PostgreSQL has no unsigned byte: the column becomessmallint, and a report that groups by it will now show 200 where the old one showed -56.- An empty string and NULL are different here. SQL Server treats
''as an empty value, Oracle-style systems treat it as NULL; PostgreSQL keeps the empty string, so aNOT NULLcolumn that arrived as''is data the application did not expect. - Case matters after the move. An unquoted identifier is folded to lower case in PostgreSQL, so
CustomerIDbecomescustomerid— fine for the database, fatal for an application that quoted its column names. - A large copy on a managed target can time out. Aurora Serverless and Azure Burstable tiers pause or throttle; run it during a stable window or in batches rather than blaming the tool for a stalled transfer.
Automate with the CLI
The application is its own command line — DBCopier on Windows, DBCopierCmd on Linux, the binary inside the .app on macOS. A nightly sync is the same session, run headless:
# the task saved from the GUI: source table, mapping and target collection
DBCopier session="mssql-to-postgres.uld" logfile="mssql-to-postgres.log"
# what it would do, without writing
DBCopier session="mssql-to-postgres.uld" --dry-run
# nightly at 02:30 - prints the scheduler entry, --install writes it
DBCopier schedule --session="mssql-to-postgres.uld" --daily=02:30 --install
One-off with no session file: DBCopier copy --from="SQLServer:sa:pw@db.local:1433/sales" --from-table=ORDERS --to="PostgreSQL:postgres:pw@pg.local:5432/sales" --to-table=orders. The full command set is on DBCopier command line.
Which Searches Land Here
This page is the SQL Server → PostgreSQL direction: migrate sql server to postgresql, sql server to postgresql migration, migrate from sql to postgresql, migrate data from sql server to postgresql, sql to postgresql.
- “migration tool” / “migration challenges” — the mapping table and the pitfalls above are the challenges; the tool is a table copy, not a code converter.
- “to aurora” / “to azure” — same copy, different target rules; see the managed-target section.
- “stored procedure” — out of scope, and said so above rather than in small print.
- the reverse direction — PostgreSQL to SQL Server.
Frequently Asked Questions
IDENTITY becomes a PostgreSQL generated identity column with the same seed and increment; money becomes numeric(19,4), because PostgreSQL has no money type. Both can be overridden per column.DBCopier schedule --daily=02:30 --install. Incremental sync upserts on the key you name; full sync replaces the target contents.CustomerID becomes customerid. An application that quotes its identifiers needs the target column created with quotes to match.Start Transfer SQL Server Data to PostgreSQL Now
Get the full version of DBCopier for your operating system — $129 one-time, volume discounts to $99, 30-day money-back.
$75 one-time · volume discounts to $55 · 30-day money-back · pricing & licence terms

