Обсуждение: Migrating PostgreSQL Stored Procedures to MSSQL 2019 for example

Поиск
Список
Период
Сортировка

Migrating PostgreSQL Stored Procedures to MSSQL 2019 for example

От
Scott Simpson
Дата:
Hi,

I need to migrate many PostgreSQL Stored Procedures and functions to MSSQL.

I can find anything online that seems to handle this task.

Are there any tools that you have that can do this job?


Kind Regards


Zellis | Scott Simpson | Senior Engineer



Thorpe Park

United Kingdom

Work : +44 (0)20 3986 3523

Email : Scott.Simpson@Zellis.com

Web : www.Zellis.com




Zellis is the trading name for Zellis Holdings Ltd and its associated companies “Zellis”.

The contents of this email are confidential to Zellis and are solely for the use of the intended recipient. If you received this email in error, please inform the sender immediately and delete the email from your system. Unless Zellis have given you express permission to do so, please do not disclose, distribute or copy the contents of this email.

Unless this email expressly states that it is a contractual offer or acceptance, it is not sent with the intention of creating a legal relationship and does not constitute an offer or acceptance which could give rise to a contract.

Any views expressed in this email are those of the individual sender unless the email specifically states them to be the views of Zellis.

Zellis Holdings Ltd - registered in England and Wales - Company No: 10975623 - Registered Office: 740 Waterside Drive, Aztec West, Almondsbury, Bristol, BS32 4UF, UK.
Вложения

RE: Migrating PostgreSQL Stored Procedures to MSSQL 2019 for example

От
Joel Rabinovitch
Дата:

Hi,

 

When we did our migration from SQL Server to PostgreSQL, we mainly used two tools:

 

sqlserver2pgsql for most of our schema-related changes. You can find that here: https://github.com/dalibo/sqlserver2pgsql.

AWS Schema Conversion Tool (SCT) for migrating views and stored functions/procedures. The AWS SCT also can do schema conversions. You can find that here: https://aws.amazon.com/dms/schema-conversion-tool/

For the AWS SCT tool, you don’t really need to use AWS schemas. You can install PostgreSQL locally, and save the SQL files it generates and then apply them yourself. Not sure if that’s a violation of their license terms though (our company does use AWS).

 

Keep in mind that these conversion tools do the majority of the work, but the output they generate needs to be reviewed. For example, columns with an isjson() constraint need to be converted to json or jsonb columns. Stored procedures/functions sometimes don’t convert at all.

 

The following sites also provide the ability to conversion SQL statements using SQL Server-specific syntax to PostgreSQL.

 

https://www.jooq.org/translate/

https://www.sqlines.com/online

https://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL

 

Hope this helps,

 

Joel

 

From: Scott Simpson <Scott.Simpson@zellis.com>
Sent: Friday, August 12, 2022 6:17 AM
To: pgsql-general@lists.postgresql.org
Subject: Migrating PostgreSQL Stored Procedures to MSSQL 2019 for example

 

ATTENTION: This email originated from outside of Tecsys. Use caution when clicking links or opening attachments. | Ce courriel provient de l'extérieur de Tecsys. Soyez prudent lorsque vous cliquez sur des liens ou ouvrez des pièces jointes.

 

Hi,

 

I need to migrate many PostgreSQL Stored Procedures and functions to MSSQL.

 

I can find anything online that seems to handle this task.

 

Are there any tools that you have that can do this job?

 

 

Kind Regards

 

Zellis | Scott Simpson | Senior Engineer

 

Thorpe Park

United Kingdom

Work : +44 (0)20 3986 3523

Email : Scott.Simpson@Zellis.com

Web : www.Zellis.com

 



Zellis is the trading name for Zellis Holdings Ltd and its associated companies “Zellis”.

The contents of this email are confidential to Zellis and are solely for the use of the intended recipient. If you received this email in error, please inform the sender immediately and delete the email from your system. Unless Zellis have given you express permission to do so, please do not disclose, distribute or copy the contents of this email.

Unless this email expressly states that it is a contractual offer or acceptance, it is not sent with the intention of creating a legal relationship and does not constitute an offer or acceptance which could give rise to a contract.

Any views expressed in this email are those of the individual sender unless the email specifically states them to be the views of Zellis.

Zellis Holdings Ltd - registered in England and Wales - Company No: 10975623 - Registered Office: 740 Waterside Drive, Aztec West, Almondsbury, Bristol, BS32 4UF, UK.

Вложения

Re: Migrating PostgreSQL Stored Procedures to MSSQL 2019 for example

От
hector vass
Дата:
I would suggest no easy way with a tool .. postgresql is powerful because you can write functions in different languages in addition to PLpgSQL so python,perl,tcl,js,c++ and there are many popular extensions.  So very possible to encapsulate complex application/business logic within database.  But if it is just a database with a bit of PLpgSQL to expose data to a front end application that does all the work then maybe a tool might work.  You may have noticed how powerful AWS SCT is converting MSSQL & Oracle to Postgresql but alas will I believe only convert Postgresql to Postres alike databases Aurora and MySQL ...
Not to say someone somewhere hasn’t but a claimed strength of Postgresql is probably a hindrance in this instance.


Hector Vass
Data Engineer 
07773 352559

On Fri, 12 Aug 2022, 11:24 Scott Simpson, <Scott.Simpson@zellis.com> wrote:
Hi,

I need to migrate many PostgreSQL Stored Procedures and functions to MSSQL.

I can find anything online that seems to handle this task.

Are there any tools that you have that can do this job?


Kind Regards


Zellis | Scott Simpson | Senior Engineer



Thorpe Park

United Kingdom

Work : +44 (0)20 3986 3523

Email : Scott.Simpson@Zellis.com

Web : www.Zellis.com




Zellis is the trading name for Zellis Holdings Ltd and its associated companies “Zellis”.

The contents of this email are confidential to Zellis and are solely for the use of the intended recipient. If you received this email in error, please inform the sender immediately and delete the email from your system. Unless Zellis have given you express permission to do so, please do not disclose, distribute or copy the contents of this email.

Unless this email expressly states that it is a contractual offer or acceptance, it is not sent with the intention of creating a legal relationship and does not constitute an offer or acceptance which could give rise to a contract.

Any views expressed in this email are those of the individual sender unless the email specifically states them to be the views of Zellis.

Zellis Holdings Ltd - registered in England and Wales - Company No: 10975623 - Registered Office: 740 Waterside Drive, Aztec West, Almondsbury, Bristol, BS32 4UF, UK.
Вложения