Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Postgresql unique objects naming convention and converting from SQL Server

One of the problems when migrating from Sql Server to PostgreSQL is dealing with PostgreSQL requirement for every object name to be Unique within a schema.  The DBA could face  this sort of issue:

1) There are SQL Server tables which may have indexes attached with the same name.

table1 with index called "myindex"

table2 with index called "myindex"

PostgreSQL requires all object’s names in a schema to be unique. Index names must be unique in the schema of the base table. SQL Server allows , an index name to bee the same for different tables. 

If you're using the AWS Schema Conversion Tool (SCT)  and want to avoid Error 42P07   , it is possible to configure the AWS SCT so it produces unique index names duing the metadata conversion process. 


To ensure the uniqueness of index names, AWS SCT gives you the option to generate unique index names if your index names are not unique.
To do this, choose the option Generate unique index names in the project properties. By default, this option is enabled.
If this option is enabled, unique index names are created using the format IX_table_name_index_name. If this option is disabled, index names aren’t changed. 



This post first appeared on Dba-ninja.com, please read the originial post: here

Share the post

Postgresql unique objects naming convention and converting from SQL Server

×

Subscribe to Dba-ninja.com

Get updates delivered right to your inbox!

Thank you for your subscription

×