From:       To:      
Home > Documentation > SQL Server to PostgreSQL

SQL Server to PostgreSQL FAQ

[The Converter]  [Tutorial]  [About Migration]

On this page you can find the most frequently asked questions regarding SQL Server to PostgreSQL converter. If your question is not answered here, please contact us via Feedback Form

Errors


What kind of database objects are migrated by the tool?

The converter processes table definitions, data, indexes, foreign keys ans views with all necessary attributes. It does not convert triggers and stored procedures/functions. SQL Server to PostgreSQL Code Converter can partially automate migration of these database objects.

Demo version of the converter migrates not more than 50 rows per table, it does not convert foreign keys and views.

If you need a proven turn-key migration, specialists of Intelligent Converters can do this for you as Database Migration Service.

[Go to Top]

What versions of SQL Server and PostgreSQL are supported?

SQL Server to PostgreSQL converter supports all versions of on-premises SQL Server starting from v2000 and all versions of PostgreSQL starting from v9.0.

Cloud variations of the database management systems are also supported:

[Go to Top]

How to specify custom ports for SQL Server and PostgreSQL?

Custom port for SQL Server (other than 1433) can be specified in "MS SQL Server" field of "Step 1 of 7. Connect to Microsoft SQL server" page as follows:

  Sql_server_name,1234

where 1234 is the custom port.

Custom port for PostgreSQL (that differs from default 5432) can be specified on "Step 2 of 7. Connect to PostgreSQL server" page of the conversion wizard. This option is only available for "Remote" connection mode. If you are connecting to local PostgreSQL server, it still can be used by specifying "127.0.0.1" or "localhost" in "Host" edit box.

[Go to Top]


Does SQL Server to PostgreSQL converter support automation?

The converter does not support automation directly, but it comes with command line version m2pagent.exe that can be called from any script. So, it is possible to write a simple batch script and execute it automatically using Windows Task Scheduler.

Refer to Command line article for more information about m2pagent.exe.

[Go to Top]


How to change destination table name?

There are two approaches to this task. First solution is to use Edit Table feature of SQL Server to PostgreSQL converter. This feature can be accessed by double click on the corresponding table name in "Selected tables" list.

Another solution is to convert contents of the table as result of SELECT-query with custom name. Click "Add Query" button on "Select tables" wizard page and compose simple query as follows:

  SELECT * FROM <original table name>

Then store query with the required name. To access this feature click "Add Query" button on "Step 5 of 7" page of SQL Server to PostgreSQL conversion wizard.

See Using Queries article for the further information.

[Go to Top]


How to rename column in the resulting PostgreSQL table?

SQL Server to PostgreSQL converter provides two options for this task. First solution is to use Edit Table feature that can be accessed by double click on the corresponding table name in "Selected tables" list.

Also, you can modify column name by migrating the corresponding table as result of SELECT-query with alias for particular column:

  SELECT FName as FirstName, ... FROM Table1

Then store query with name of the original table. To access this feature click "Add Query" button on "Step 5 of 7" page of of SQL Server to PostgreSQL conversion wizard.

See Using Queries article for the further information.

[Go to Top]


Why some indexes are created with "00000", "00001", ... suffixes added to the name?

The converter may add those suffixes to make index name unique. Unlike SQL Server, PostreSQL requires index name to be unique across the entire database.

[Go to Top]


How to migrate SQL Server tables from all schemas?

SQL Server to PostgreSQL converter allows to specify source and target schemas during migration. To extract and migrate full list of schemas from the original database, select "Full replication" option on the "Conversion Settings" wizard page.

Use this mode to preserve full names of all tables the same as in the original database (for examle "schema1"."table1"). In this mode SQL Server default schema "dbo" will be also migrated to PostgreSQL unchanged. It will not be converted into PostgreSQL default schema "public".

[Go to Top]


How to migrate only fragments of data, not entire table?

Some projects require to migrate only some fragments of data filtered by particular conditions. SQL Server to PostgreSQL converter offers a feature to completely control the data to migrate. This is filtering data via SELECT-queries that allows to migrate result of user-defined SELECT-query as if it would be a regular table.

To use this feature, please follow these steps:

[Go to Top]