# MSSQL to PostgreSQL Migration

**URL:** <https://forum.inductiveautomation.com/t/mssql-to-postgresql-migration/88279>\
**Category:** Ignition\
**Tags:** database\
**Created:** [April 3, 2024, 10:09am UTC](https://forum.inductiveautomation.com/t/mssql-to-postgresql-migration/88279 "2024-04-03T10:09:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Irfan\_Shaik](https://avatars.discourse-cdn.com/v4/letter/i/53a042/32.png) [@Irfan\_Shaik](https://forum.inductiveautomation.com/u/Irfan_Shaik)\
**Post date:** [April 3, 2024, 10:09am UTC](https://forum.inductiveautomation.com/t/mssql-to-postgresql-migration/88279/1 "2024-04-03T10:09:56Z")

</div>

We are planning to move from MSSQL to PostgrSQL . With respect to Ignition related database other than schema, data migration ,PostgreSQL JDBC driver and connection properties configuration in ignition, what other aspects need to be considered ?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 3, 2024, 11:18am UTC](https://forum.inductiveautomation.com/t/mssql-to-postgresql-migration/88279/2 "2024-04-03T11:18:19Z")

</div>

The default identifier quoting (square brackets) in MS SQL doesn't work in any other brand of database. Start by setting your SQL Server to allow "ANSI" quotes, the standard, and convert all of your queries to use them. (Double quote marks are for identifiers, single quote marks for data, per the SQL standard.)

Also convert queries to use quoting where your tables aren't entirely lower case. MS SQL Server is case-insensitive case-preserving. PostgreSQL is entirely case-sensitive and converts unquoted identifiers to lower case.

While doing that, look for SQL functions that are different in PostgreSQL (sorry, I don't have a list) and note where they are so they can be fixed after migration.

---

<div class="post-metadata">

**Author:** ![Irfan\_Shaik](https://avatars.discourse-cdn.com/v4/letter/i/53a042/32.png) [@Irfan\_Shaik](https://forum.inductiveautomation.com/u/Irfan_Shaik)\
**Post date:** [April 4, 2024, 4:22pm UTC](https://forum.inductiveautomation.com/t/mssql-to-postgresql-migration/88279/3 "2024-04-04T16:22:43Z")

</div>

And for ignition built-in database (alarm history and other tables) what efforts are involved in migration?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 4, 2024, 4:32pm UTC](https://forum.inductiveautomation.com/t/mssql-to-postgresql-migration/88279/4 "2024-04-04T16:32:54Z")

</div>

Generally nothing. All of Ignition's automatically generated tables use lower case with no spaces or special characters, so they are compatible across all DB brands without identifier quoting.

---

<div class="post-metadata">

**Author:** ![Irfan\_Shaik](https://avatars.discourse-cdn.com/v4/letter/i/53a042/32.png) [@Irfan\_Shaik](https://forum.inductiveautomation.com/u/Irfan_Shaik)\
**Post date:** [April 4, 2024, 4:46pm UTC](https://forum.inductiveautomation.com/t/mssql-to-postgresql-migration/88279/5 "2024-04-04T16:46:13Z")

</div>

> [@pturmel](#):
>
> . All of Ignition's automatically generated tables use lower case with no spaces or special characters, so they are compatible across all DB brands without identifier quoting.

Thank you . That helps a lot .

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 4, 2024, 4:51pm UTC](https://forum.inductiveautomation.com/t/mssql-to-postgresql-migration/88279/6 "2024-04-04T16:51:21Z")

</div>

Note that timestamps that are actual datetime or datetime2 column types will likely need special care, as the corresponding PostgreSQL types (timestamp and timestamptz) have some semantic differences. Use `timestamptz` for most cases to maximize robustness with time zones.

(I generally change Ignition's PostgreSQL translator to use `timestamptz` by default.)
