Amazon AWS Schema Conversion Tool User Guide
The AWS Schema Conversion Tool (AWS SCT) provides a project-based user interface to convert your existing database schema from one database engine to another. You can convert relational OLTP schema, or data warehouse schema. The converted schema is suitable for an Amazon Relational Database Service (Amazon RDS) MySQL DB instance, an Amazon Aurora DB cluster, an Amazon RDS PostgreSQL DB instance, or an Amazon Redshift cluster.
Advertisement
Advertisement
AWS Schema Conversion Tool
User Guide
Version 1.0
AWS Schema Conversion Tool User Guide
AWS Schema Conversion Tool: User Guide
Copyright © 2017 Amazon Web Services, Inc. and/or its affiliates. All rights reserved.
Amazon's trademarks and trade dress may not be used in connection with any product or service that is not Amazon's, in any manner that is likely to cause confusion among customers, or in any manner that disparages or discredits Amazon. All other trademarks not owned by Amazon are the property of their respective owners, who may or may not be affiliated with, connected to, or sponsored by
Amazon.
AWS Schema Conversion Tool User Guide
Table of Contents
Version 1.0
iii
AWS Schema Conversion Tool User Guide
Version 1.0
iv
AWS Schema Conversion Tool User Guide
Version 1.0
v
AWS Schema Conversion Tool User Guide
Version 1.0
vi
AWS Schema Conversion Tool User Guide
What Is the AWS Schema Conversion
Tool?
You can use the AWS Schema Conversion Tool (AWS SCT) to convert your existing database schema from one database engine to another. You can convert relational OLTP schema, or data warehouse schema.
Your converted schema is suitable for an Amazon Relational Database Service (Amazon RDS) MySQL DB instance, an Amazon Aurora DB cluster, an Amazon RDS PostgreSQL DB instance, or an Amazon Redshift cluster.
Note
You can migrate schema and data from MySQL to an Amazon Aurora (MySQL) DB cluster without using AWS SCT. For more information, see Migrating Data to an Amazon Aurora DB
Cluster .
AWS SCT supports the following OLTP conversions.
Source Database
Microsoft SQL Server (version 2008 and later)
MySQL (version 5.6 and later)
Oracle (version 10.2 and later)
PostgreSQL (version 9.1 and later)
Target Database on Amazon RDS
Amazon Aurora (MySQL or PostgreSQL), Microsoft
SQL Server, MySQL, PostgreSQL
Amazon Aurora (PostgreSQL), MySQL, PostgreSQL
Amazon Aurora (MySQL or PostgreSQL), MySQL,
Oracle, PostgreSQL
Amazon Aurora (MySQL), MySQL, PostgreSQL
AWS SCT supports the following data warehouse conversions.
Source Database
Greenplum Database (version 4.3 and later)
Microsoft SQL Server (version 2008 and later)
Version 1.0
1
Target Database on Amazon Redshift
Amazon Redshift
Amazon Redshift
AWS Schema Conversion Tool User Guide
Converting Your Schema
Source Database
Netezza (version 7.2 and later)
Oracle (version 11 and later)
Teradata (version 14 and later)
Vertica (version 7.2.2 and later)
Target Database on Amazon Redshift
Amazon Redshift
Amazon Redshift
Amazon Redshift
Amazon Redshift
Converting Your Schema
AWS SCT provides a project-based user interface to automatically convert the database schema of your source database into a format compatible with your target Amazon RDS instance. If schema from your source database can't be converted automatically, AWS SCT provides guidance on how you can create equivalent schema in your target Amazon RDS database.
For information about how to install AWS SCT, see
Installing and Updating the AWS Schema Conversion
To get started with AWS SCT, and create your first project, see
Getting Started with the AWS Schema
To start converting your schema, see Converting Database Schema to Amazon RDS by Using the AWS
Schema Conversion Tool (p. 68)
or
Converting Data Warehouse Schema to Amazon Redshift by Using the AWS Schema Conversion Tool (p. 87)
.
Additional Features of the AWS Schema
Conversion Tool
In addition to converting your existing database schema from one database engine to another, AWS SCT has some additional features that help you move your data and applications to the cloud:
• You can use data extraction agents to extract data from your data warehouse to prepare to migrate it to Amazon Redshift. To manage the data extraction agents, you can use AWS SCT. For more
information, see Using Data Extraction Agents (p. 110) .
• You can use AWS SCT to create AWS DMS endpoints and tasks. You can run and monitor these tasks
from AWS SCT. For more information, see Working with the AWS Database Migration Service Using the
AWS Schema Conversion Tool (p. 121) .
• In some cases, database features can't be converted to equivalent Amazon RDS or Amazon Redshift features. The AWS SCT extension pack wizard can help you install AWS Lambda functions and Python libraries to emulate the features that can't be converted. For more information, see
Conversion Tool Extension Pack and AWS Services for Databases (p. 84)
and
Conversion Tool Extension Pack and Python Libraries for Data Warehouses (p. 108)
.
• You can use AWS SCT to optimize your existing Amazon Redshift database. AWS SCT recommends sort keys and distribution keys to optimize your database. For more information, see
Redshift by Using the AWS Schema Conversion Tool (p. 119)
.
Version 1.0
2
AWS Schema Conversion Tool User Guide
The Project Window
• You can use AWS SCT to copy your existing on-premises database schema to an Amazon RDS DB instance running the same engine. You can use this feature to analyze potential cost savings of moving to the cloud and of changing your license type.
• You can use AWS SCT to convert SQL in your C++, C#, Java, or other application code. You can view, analyze, edit, and save the converted SQL code. For more information, see
Converting Application SQL by Using the AWS Schema Conversion Tool (p. 124) .
The Project Window
The illustration following is what you see in the AWS Schema Conversion Tool when you create a schema migration project, and then convert a schema.
1. In the left panel, the schema from your source database is presented in a tree view. Your database schema is "lazy loaded." In other words, when you select an item from the tree view, AWS SCT gets and displays the current schema from your source database.
2. In the top middle panel, action items appear for schema elements from the source database engine that couldn't be converted automatically to the target database engine.
3. In the right panel, the schema from your target DB instance is presented in a tree view. Your database schema is "lazy loaded." That is, at the point when you select an item from the tree view, AWS SCT gets and displays the current schema from your target database.
Version 1.0
3
AWS Schema Conversion Tool User Guide
Feedback
4. In the lower left panel, when you choose a schema element, properties describing the source schema element and the SQL command to create that element in the source database are displayed.
5. In the lower right panel, when you choose a schema element, properties describing the target schema element and the SQL command to create that element in the target database are displayed. You can edit this SQL command and save the updated command with your project.
Providing Customer Feedback
You can provide feedback about the AWS Schema Conversion Tool. You can file a bug report, you can submit a feature request, or you can provide general information.
To provide feedback about AWS SCT.
1. Start the AWS Schema Conversion Tool.
2. Open the Help menu and then choose Leave Feedback. The Leave Feedback dialog box appears.
Version 1.0
4
AWS Schema Conversion Tool User Guide
Related Topics
3. For Area, choose Information, Bug report, or Feature request.
4. For Source database, choose your source database. Choose Any if your feedback is not specific to a particular database.
5. For Target database, choose your target database. Choose Any if your feedback is not specific to a particular database.
6. For Title, type a title for your feedback.
7. For Message, type your feedback.
8. Choose Send to submit your feedback.
Related Topics
•
Working with Databases (p. 67)
•
Working with Data Warehouses (p. 86)
•
Best Practices for the AWS Schema Conversion Tool (p. 134)
Version 1.0
5
AWS Schema Conversion Tool User Guide
Installing the AWS Schema Conversion Tool
Installing and Updating the AWS
Schema Conversion Tool
The AWS Schema Conversion Tool (AWS SCT) is a stand-alone application that provides a project-based user interface. AWS SCT is available for Fedora Linux, macOS, Microsoft Windows, and Ubuntu Linux version 15.04. AWS SCT is supported only on 64-bit operating systems. AWS SCT also installs the Java
Runtime Environment (JRE) version 8u45.
Installing the AWS Schema Conversion Tool
To install the AWS Schema Conversion Tool
1. Download the zip file that contains the AWS SCT installer, using the link for your operating system, shown following:
• Fedora Linux download
• macOS download
• Microsoft Windows download
• Ubuntu Linux version 15.04 download
2. Extract the AWS SCT installer file for your operating system, shown following.
Operating System File Name
Fedora Linux macOS aws-schema-conversion-tool-1.0.
build-number
.x86_64.rpm
AWS Schema Conversion Tool-1.0.
build-number
.dmg
Microsoft Windows
AWS Schema Conversion Tool-1.0.
build-number
.msi
Ubuntu Linux aws-schema-conversion-tool-1.0.
build-number
.deb
3. Run the AWS SCT installer file extracted in the previous step. Use the instructions for your operating system, shown following.
Operating System
Fedora Linux
Install Instructions
Run the following command in the folder that you downloaded the file to:
Version 1.0
6
AWS Schema Conversion Tool User Guide
Installing the Required Database Drivers
Operating System
macOS
Microsoft Windows
Ubuntu Linux
Install Instructions
sudo yum install aws-schema-conversion-tool-1.0.
buildnumber
.x86_64.rpm
In Finder, open
AWS Schema Conversion Tool-1.0.
build-number
.dmg
.
Drag
AWS Schema Conversion Tool-1.0.
build-number
.dmg
to the
Applications folder.
Double-click the file to run the installer.
Run the following command in the folder that you downloaded the file to: sudo dpkg -i aws-schema-conversion-tool-1.0.
build-number
.deb
4. Install the Java Database Connectivity (JDBC) drivers for your source and target database engines.
For instructions and download links, see Installing the Required Database Drivers (p. 7)
.
Installing the Required Database Drivers
For the AWS Schema Conversion Tool to work correctly, you must install the JDBC drivers for your source and target database engines. When in doubt, install the latest version of the driver available.
After you download the drivers, you give the location of the driver files. For more information, see
Storing Driver Paths in the Global Settings (p. 9)
.
You can download the database drivers from the following locations.
Database
Engine
Amazon
Aurora (MySQL compatible)
Amazon
Aurora
(PostgreSQL compatible)
Amazon
Redshift
Greenplum
Database
Microsoft SQL
Server
MySQL
Netezza
Drivers
mysql-connector-java-5.1.6.jar
sqljdbc4.jar
mysql-connector-java-5.1.6.jar
nzjdbc.jar
Use the client tools software.
Download Location
https://www.mysql.com/products/connector/ postgresql-9.4-1204-jdbc42.jar
https://jdbc.postgresql.org/download.html
RedshiftJDBC41-1.1.10.1010.jar
http://docs.aws.amazon.com/redshift/latest/ mgmt/configure-jdbc-connection.html
postgresql-9.4-1204-jdbc42.jar
https://jdbc.postgresql.org/ https://www.microsoft.com/en-us/download/ details.aspx?displaylang=en&id=11774 https://www.mysql.com/products/connector/ http://www.ibm.com/support/knowledgecenter/
SSULQD_7.2.1/com.ibm.nz.datacon.doc/ c_datacon_plg_overview.html
Version 1.0
7
AWS Schema Conversion Tool User Guide
Installing JDBC Drivers on Linux
Database
Engine
Oracle
PostgreSQL
Teradata
Vertica
Drivers Download Location
ojdbc7.jar
Driver versions 7 and later are supported.
vertica-jdbc-7.2.3-0_all
Driver versions 7.2.0 and later are supported.
http://www.oracle.com/technetwork/ database/features/jdbc/jdbc-drivers-12cdownload-1958347.html
postgresql-9.4-1204-jdbc42.jar
https://jdbc.postgresql.org/download.html
terajdbc4.jar
https://downloads.teradata.com/download/ connectivity/jdbc-driver tdgssconfig.jar
https://my.vertica.com/download/vertica/clientdrivers/
Installing JDBC Drivers on Linux
You can use the following steps to install the JDBC drivers on your Linux system for use with AWS SCT.
To install JDBC drivers on your Linux system
1. Create a directory to store the JDBC drivers in.
PROMPT>sudo mkdir –p /usr/local/jdbc-drivers
2. Install the JDBC driver for your database engine using the commands shown following.
Database Engine
Amazon Aurora
(MySQL compatible)
Installation Commands
Amazon Aurora
(PostgreSQL compatible)
Microsoft SQL Server
PROMPT> cd /usr/local/jdbc-drivers
PROMPT> sudo cp -a /tmp/postgresql-X.X.X.jre7.tar .
PROMPT> cd /usr/local/jdbc-drivers
PROMPT> sudo tar xzvf /tmp/sqljdbc_X.X.X_enu.tar.gz
MySQL
PROMPT> cd /usr/local/jdbc-drivers
PROMPT> sudo tar xzvf /tmp/mysql-connector-java-X.X.X.tar.gz
PROMPT> cd /usr/local/jdbc-drivers
PROMPT> sudo tar xzvf /tmp/mysql-connector-java-X.X.X.tar.gz
Oracle
PROMPT> cd /usr/local/jdbc-drivers
PROMPT> sudo mkdir oracle-jdbc
PROMPT> cd oracle-jdbc
Version 1.0
8
Database Engine
AWS Schema Conversion Tool User Guide
Storing Driver Paths in the Global Settings
Installation Commands
PROMPT> sudo cp -a /tmp/ojdbc7.jar .
PostgreSQL
PROMPT> cd /usr/local/jdbc-drivers
PROMPT> sudo cp -a /tmp/postgresql-X.X.X.jre7.tar .
Storing Driver Paths in the Global Settings
After you have downloaded and installed the required JDBC drivers, you can set the location of the drivers globally in the AWS SCT settings. If you don't set the location of the drivers globally, the application asks you for the location of the drivers when you connect to a database.
To update the driver file locations
1. In the AWS Schema Conversion Tool, choose Settings, and then choose Global Settings.
2. For Global settings, choose Drivers. Add the file path to the JDBC driver for your source database engine and your target Amazon RDS DB instance database engine.
Note
For Teradata, you specify 2 drivers separated by a semicolon.
Version 1.0
9
AWS Schema Conversion Tool User Guide
Updating the AWS Schema Conversion Tool
3. When you are finished adding the driver paths, choose OK.
Updating the AWS Schema Conversion Tool
To check whether new version of AWS SCT is available, choose Help, and then choose Check for
Updates. If there is a newer version of AWS SCT available, you are prompted to download and install the newer version.
Related Topics
•
What Is the AWS Schema Conversion Tool? (p. 1)
•
Getting Started with the AWS Schema Conversion Tool (p. 11)
Version 1.0
10
AWS Schema Conversion Tool User Guide
Before You Begin
Getting Started with the AWS
Schema Conversion Tool
Following, you can find procedures that help you get started using the AWS Schema Conversion Tool
(AWS SCT). AWS SCT provides a project-based user interface. Almost all work you do with AWS SCT starts with the following three steps:
1. Create an AWS SCT project.
2. Connect to your source database.
3. Connect to your target database.
Before You Begin
Before you complete the procedures in this topic, you must first do the following:
• Install the AWS Schema Conversion Tool. For more information, see Installing and Updating the AWS
.
• Create your target Amazon Relational Database Service (Amazon RDS) DB instance or Amazon Redshift database, if it doesn't already exist. For more information, see the following documentation.
Database Engine
Amazon Aurora
Amazon Redshift
Relevant Documentation
Creating an Amazon Aurora DB Cluster
Connecting to an Amazon Aurora DB Cluster
Getting Started with Amazon Redshift
Version 1.0
11
AWS Schema Conversion Tool User Guide
Creating a Project
Database Engine
Microsoft SQL Server
MySQL
Oracle
Relevant Documentation
Creating a DB Instance Running the Microsoft SQL Server Database Engine
Connecting to a DB Instance Running the Microsoft SQL Server Database
Engine
Creating a DB Instance Running the MySQL Database Engine
Connecting to a DB Instance Running the MySQL Database Engine
Creating a DB Instance Running the Oracle Database Engine
Connecting to a DB Instance Running the Oracle Database Engine
Creating a DB Instance Running the PostgreSQL Database Engine PostgreSQL
Connecting to a DB Instance Running the PostgreSQL Database Engine
• Verify that you have sufficient privileges for the source and target databases so that you can run AWS
SCT. For more information, see
Required Database Privileges for Using the AWS Schema Conversion
Creating an AWS Schema Conversion Tool Project
The following procedure shows you how to create an AWS Schema Conversion Tool project.
To create your project
1. Start the AWS Schema Conversion Tool.
2. Choose New Project from the File menu. The New Project dialog box appears.
3. Add the following preliminary project information.
For This Parameter
Project Name
Location
Do This
Type a name for your project, which is stored locally on your computer.
Type the location for your local project file.
Version 1.0
12
AWS Schema Conversion Tool User Guide
Connecting to Your Source Database
For This Parameter
Source DB Engine
Do This
Choose Transactional Database (OLTP) or Data Warehouse
(OLAP).
(OLTP) Choose Microsoft SQL Server, MySQL, Oracle, or
PostgreSQL.
Target DB Engine
(OLAP) Choose Amazon Redshift, Greenplum, Microsoft SQL
Server DW, Netezza, Oracle DW, Teradata, or Vertica.
(OLTP) Choose
Amazon Aurora (MySQL compatible), Amazon
Aurora (PostgreSQL compatible), Amazon RDS for Microsoft
SQL Server, Amazon RDS for MySQL, Amazon RDS for Oracle, or Amazon RDS for PostgreSQL.
(OLAP) Choose
Amazon Redshift.
4. Choose OK to create your AWS SCT project.
Connecting to Your Source Database
The following topics show you how to connect to your source database. Choose the topic appropriate for your source database.
•
Connecting to an Amazon Redshift Source Database (p. 42)
•
Connecting to a Greenplum Source Database (p. 44)
•
Connecting to a Microsoft SQL Server Source Database (p. 46)
•
Connecting to a Microsoft SQL Server Data Warehouse Source Database (p. 48)
•
Connecting to a MySQL Source Database (p. 50)
•
Connecting to a Netezza Source Database (p. 52)
•
Connecting to an Oracle Source Database (p. 54)
•
Connecting to an Oracle Data Warehouse Source Database (p. 57)
•
Connecting to a PostgreSQL Source Database (p. 60)
•
Connecting to a Teradata Source Database (p. 62)
•
Connecting to a Vertica Source Database (p. 64)
Connecting to Your Target Database
The following procedure shows you how to connect to your target database.
To connect to your target database
1. Start the AWS Schema Conversion Tool.
2. Choose
Connect to
target
, where
target
indicates the database engine for your target DB instance.
3. Add the following information to connect to your target Amazon RDS DB instance.
For This Parameter
Server name
Do This
Type the DNS name of your target DB instance.
Version 1.0
13
AWS Schema Conversion Tool User Guide
Converting Your Schema
For This Parameter Do This
Server port
User name and
Password
Type the port used to connect to your target DB instance.
Type the user name and password to connect to your target DB instance.
Note
AWS SCT uses the password to connect to your target database only when you create your project or choose the
Connect to
target
option in a project, where
target
is your target database. To guard against exposing the password for your target database, AWS SCT doesn't store the password. If you close your AWS SCT project and reopen it, you are prompted for the password to connect to your target database as needed.
Use SSL
Select this option if you want to use SSL to connect to your database.
Provide additional information, as appropriate, on the SSL tab.
4. Choose Test Connection to verify that you can successfully connect to your target database.
5. Choose OK to connect to your target DB instance.
Converting Your Schema
After you get started by using the procedures in this topic, you can continue working with AWS SCT with transactional databases and data warehouses in the following topics:
•
Getting Started Converting Database Schema with the AWS Schema Conversion Tool (p. 23)
•
Getting Started Converting Data Warehouse Schema with the AWS Schema Conversion Tool (p. 31)
Version 1.0
14
AWS Schema Conversion Tool User Guide
Required Database Privileges
Required Database Privileges for Using the AWS
Schema Conversion Tool
When you use the AWS Schema Conversion Tool (AWS SCT) to convert your database schema, you need certain privileges for the source and target databases. Following, you can find lists of these privileges.
•
Source: Amazon Redshift (p. 15)
•
•
Source: Microsoft SQL Server (p. 16)
•
Source: Microsoft SQL Server Data Warehouse (p. 16)
•
•
•
•
Source: Oracle Data Warehouse (p. 17)
•
•
•
•
Target: Amazon Aurora (MySQL) (p. 18)
•
Target: Amazon Aurora (PostgreSQL) (p. 18)
•
Target: Amazon Redshift (p. 18)
•
Target: Microsoft SQL Server (p. 19)
•
•
•
Privileges for Amazon Redshift as a Source Database
The privileges required for Amazon Redshift as a source are listed following:
• USAGE ON SCHEMA
<schema_name>
• SELECT ON ALL TABLES IN SCHEMA
<schema_name>
• SELECT ON PG_CATALOG.PG_STATISTIC
• SELECT ON SVV_TABLE_INFO
• SELECT ON TABLE STV_BLOCKLIST
• SELECT ON TABLE STV_TBL_PERM
Privileges for Greenplum as a Source Database
The privileges required for Greenplum as a source are listed following:
• CONNECT ON DATABASE
<database_name>
• USAGE ON SCHEMA
<schema_name>
Version 1.0
15
AWS Schema Conversion Tool User Guide
Source: Microsoft SQL Server
Privileges for Microsoft SQL Server as a Source
Database
The privileges required for Microsoft SQL Server as a source are listed following:
• VIEW DEFINITION
• VIEW DATABASE STATE
Repeat the grant for each database whose schema you are converting.
Privileges for Microsoft SQL Server Data Warehouse as a Source Database
The privileges required for Microsoft SQL Server data warehouse as a source are listed following:
• VIEW DEFINITION
• VIEW DATABASE STATE
• SELECT ON SCHEMA ::
<schema_name>
Repeat the grant for each database whose schema you are converting.
In addition, grant the following, and run the grant on the master database:
• VIEW SERVER STATE
Privileges for MySQL as a Source Database
The privileges required for MySQL as a source are listed following:
• SELECT ON *.*
• SELECT ON mysql.proc
• SHOW VIEW ON *.*
Privileges for Netezza as a Source Database
The privileges required for Netezza as a source are listed following:
• SELECT ON SYSTEM.DEFINITION_SCHEMA.SYSTEM VIEW
• SELECT ON SYSTEM.DEFINITION_SCHEMA.SYSTEM TABLE
• SELECT ON SYSTEM.DEFINITION_SCHEMA.MANAGEMENT TABLE
• LIST ON
<database_name>
• LIST ON
<database_name>
.ALL.TABLE
• LIST ON
<database_name>
.ALL.EXTERNAL TABLE
• LIST ON
<database_name>
.ALL.VIEW
• LIST ON
<database_name>
.ALL.MATERIALIZED VIEW
• LIST ON
<database_name>
.ALL.PROCEDURE
Version 1.0
16
AWS Schema Conversion Tool User Guide
Source: Oracle
• LIST ON
<database_name>
.ALL.SEQUENCE
• LIST ON
<database_name>
.ALL.FUNCTION
• LIST ON
<database_name>
.ALL.AGGREGATE
Privileges for Oracle as a Source Database
The privileges required for Oracle as a source are listed following:
• connect
• select_catalog_role
• select any dictionary
Privileges for Oracle Data Warehouse as a Source
Database
The privileges required for Oracle Data Warehouse as a source are listed following:
• connect
• select_catalog_role
• select any dictionary
Privileges for PostgreSQL as a Source Database
The privileges required for PostgreSQL as a source are listed following:
• CONNECT ON DATABASE
<database_name>
• USAGE ON SCHEMA
<database_name>
• SELECT ON ALL TABLES IN SCHEMA
<database_name>
• SELECT ON ALL SEQUENCES IN SCHEMA
<database_name>
Privileges for Teradata as a Source Database
The privileges required for Teradata as a source are listed following:
• SELECT ON DBC
Privileges for Vertica as a Source Database
The privileges required for Vertica as a source are listed following:
• USAGE ON SCHEMA
<schema_name>
• USAGE ON SCHEMA PUBLIC
• GRANT SELECT ON ALL TABLES IN SCHEMA
<schema_name>
• SELECT ON ALL SEQUENCES IN SCHEMA
<schema_name>
• EXECUTE ON ALL FUNCTIONS IN SCHEMA
<schema_name>
• EXECUTE ON PROCEDURE
<schema_name.procedure_name(procedure_signature)>
Version 1.0
17
AWS Schema Conversion Tool User Guide
Target: Amazon Aurora (MySQL)
Privileges for Amazon Aurora (MySQL) as a Target
Database
The privileges required for Amazon Aurora (MySQL) as a target are listed following:
• CREATE ON *.*
• ALTER ON *.*
• DROP ON *.*
• INDEX ON *.*
• REFERENCES ON *.*
• SELECT ON *.*
• CREATE VIEW ON *.*
• SHOW VIEW ON *.*
• TRIGGER ON *.*
• CREATE ROUTINE ON *.*
• ALTER ROUTINE ON *.*
• EXECUTE ON *.*
• SELECT ON mysql.proc
If your source database is Microsoft SQL Server, grant the additional privilege INSERT,UPDATE ON
AWS_SQLSERVER_EXT.*
If your source database is Oracle, grant the additional privilege INSERT,UPDATE ON AWS_ORACLE_EXT.*
If your source database is PostgreSQL, grant the additional privilege INSERT,UPDATE ON
AWS_POSTGRESQL_EXT.*
Privileges for Amazon Aurora (PostgreSQL) as a
Target Database
The privileges required for Amazon Aurora (PostgreSQL) as a target are explained following.
If the new schema doesn't exist yet, grant the privilege CREATE ON DATABASE
<database_name>
If the new schema already exists, grant the privilege INSERT ON ALL TABLES IN SCHEMA
<schema_name>
In PostgreSQL, only the owner of a schema or a superuser can drop a schema. The owner can drop the schema, and all contained objects, even if the owner doesn't own all of the contained objects.
Privileges for Amazon Redshift as a Target Database
The privileges required for Amazon Redshift as a target are listed following:
• CREATE ON DATABASE
<database_name>
• USAGE ON LANGUAGE plpythonu
• SELECT ON ALL TABLES IN SCHEMA pg_catalog
In Amazon Redshift, only the owner of a schema or a superuser can drop a schema. The owner can drop the schema, and all contained objects, even if the owner doesn't own all of the contained objects.
Version 1.0
18
AWS Schema Conversion Tool User Guide
Target: Microsoft SQL Server
Privileges for Microsoft SQL Server as a Target
Database
The privileges required for Microsoft SQL Server as a target are listed following:
• CREATE SCHEMA
• CREATE TABLE
• CREATE VIEW
• CREATE TYPE
• CREATE DEFAULT
• CREATE FUNCTION
• CREATE PROCEDURE
• CREATE ASSEMBLY
• CREATE AGGREGATE
• CREATE FULLTEXT CATALOG
Privileges for MySQL as a Target Database
The privileges required for MySQL as a target are listed following:
• CREATE ON *.*
• ALTER ON *.*
• DROP ON *.*
• INDEX ON *.*
• REFERENCES ON *.*
• SELECT ON *.*
• CREATE VIEW ON *.*
• SHOW VIEW ON *.*
• TRIGGER ON *.*
• CREATE ROUTINE ON *.*
• ALTER ROUTINE ON *.*
• EXECUTE ON *.*
• SELECT ON mysql.proc
If your source database is Microsoft SQL Server, grant the additional privilege INSERT,UPDATE ON
AWS_SQLSERVER_EXT.*
If your source database is Oracle, grant the additional privilege INSERT,UPDATE ON AWS_ORACLE_EXT.*
If your source database is PostgreSQL, grant the additional privilege INSERT,UPDATE ON
AWS_POSTGRESQL_EXT.*
Privileges for Oracle as a Target Database
The privileges required for Oracle as a target are listed following:
• SELECT_CATALOG_ROLE
• RESOURCE
Version 1.0
19
AWS Schema Conversion Tool User Guide
Target: Oracle
• CONNECT
• alter user
<username>
quota unlimited on USERS;
• alter user
<username>
quota unlimited on IDX;
• alter user
<username>
quota unlimited on ARCH;
• alter user
<username>
quota unlimited on ARCH_IDX;
• DROP ANY CUBE BUILD PROCESS
• ALTER ANY CUBE
• CREATE ANY CUBE DIMENSION
• CREATE ANY ASSEMBLY
• ALTER ANY RULE
• SELECT ANY DICTIONARY
• ALTER ANY DIMENSION
• CREATE ANY DIMENSION
• ALTER ANY TYPE
• DROP ANY TRIGGER
• CREATE ANY VIEW
• ALTER ANY CUBE BUILD PROCESS
• CREATE ANY CREDENTIAL
• DROP ANY CUBE DIMENSION
• DROP ANY ASSEMBLY
• DROP ANY PROCEDURE
• ALTER ANY PROCEDURE
• ALTER ANY SQL TRANSLATION PROFILE
• DROP ANY MEASURE FOLDER
• CREATE ANY MEASURE FOLDER
• DROP ANY CUBE
• DROP ANY MINING MODEL
• CREATE ANY MINING MODEL
• DROP ANY EDITION
• CREATE ANY EVALUATION CONTEXT
• DROP ANY DIMENSION
• ALTER ANY INDEXTYPE
• DROP ANY TYPE
• CREATE ANY PROCEDURE
• CREATE ANY SQL TRANSLATION PROFILE
• CREATE ANY CUBE
• COMMENT ANY MINING MODEL
• ALTER ANY MINING MODEL
• DROP ANY SQL PROFILE
• CREATE ANY JOB
• DROP ANY EVALUATION CONTEXT
• ALTER ANY EVALUATION CONTEXT
• CREATE ANY INDEXTYPE
• CREATE ANY OPERATOR
• CREATE ANY TRIGGER
• DROP ANY ROLE
Version 1.0
20
AWS Schema Conversion Tool User Guide
Target: Oracle
• DROP ANY SEQUENCE
• DROP ANY CLUSTER
• DROP ANY SQL TRANSLATION PROFILE
• ALTER ANY ASSEMBLY
• CREATE ANY RULE SET
• ALTER ANY OUTLINE
• UNDER ANY TYPE
• CREATE ANY TYPE
• DROP ANY MATERIALIZED VIEW
• ALTER ANY ROLE
• DROP ANY VIEW
• ALTER ANY INDEX
• COMMENT ANY TABLE
• CREATE ANY TABLE
• CREATE USER
• DROP ANY RULE SET
• CREATE ANY CONTEXT
• DROP ANY INDEXTYPE
• ALTER ANY OPERATOR
• CREATE ANY MATERIALIZED VIEW
• ALTER ANY SEQUENCE
• DROP ANY SYNONYM
• CREATE ANY SYNONYM
• DROP USER
• ALTER ANY MEASURE FOLDER
• ALTER ANY EDITION
• DROP ANY RULE
• CREATE ANY RULE
• ALTER ANY RULE SET
• CREATE ANY OUTLINE
• UNDER ANY TABLE
• UNDER ANY VIEW
• DROP ANY DIRECTORY
• ALTER ANY CLUSTER
• CREATE ANY CLUSTER
• ALTER ANY TABLE
• CREATE ANY CUBE BUILD PROCESS
• ALTER ANY CUBE DIMENSION
• CREATE ANY EDITION
• CREATE ANY SQL PROFILE
• ALTER ANY SQL PROFILE
• DROP ANY OUTLINE
• DROP ANY CONTEXT
• DROP ANY OPERATOR
• DROP ANY LIBRARY
• ALTER ANY LIBRARY
Version 1.0
21
AWS Schema Conversion Tool User Guide
Target: PostgreSQL
• CREATE ANY LIBRARY
• ALTER ANY MATERIALIZED VIEW
• ALTER ANY TRIGGER
• CREATE ANY SEQUENCE
• DROP ANY INDEX
• CREATE ANY INDEX
• DROP ANY TABLE
Privileges for PostgreSQL as a Target Database
The privileges required for PostgreSQL as a target are explained following.
If the new schema doesn't exist yet, grant the privilege CREATE ON DATABASE
<database_name>
If the new schema already exists, grant the privilege INSERT ON ALL TABLES IN SCHEMA
<schema_name>
In PostgreSQL, only the owner of a schema or a superuser can drop a schema. The owner can drop the schema, and all contained objects, even if the owner doesn't own all of the contained objects.
Related Topics
•
Getting Started with the AWS Schema Conversion Tool (p. 11)
Version 1.0
22
AWS Schema Conversion Tool User Guide
Getting Started Converting Database Schema
Getting Started Converting Database Schema with the AWS Schema Conversion Tool
Following, you can find information to help you convert your online transaction processing (OLTP) database schema from one database engine to another by using the AWS Schema Conversion Tool (AWS
SCT). You can use the converted schema with an Amazon Relational Database Service (Amazon RDS) DB instance.
AWS SCT supports the following OLTP database conversions.
Source Database
Microsoft SQL Server (version 2008 and later)
MySQL (version 5.6 and later)
Oracle (version 10.2 and later)
PostgreSQL (version 9.1 and later)
Target Database on Amazon RDS
Amazon Aurora (MySQL or PostgreSQL), Microsoft
SQL Server, MySQL, PostgreSQL
Amazon Aurora (PostgreSQL), MySQL, PostgreSQL
Amazon Aurora (MySQL or PostgreSQL), MySQL,
Oracle, PostgreSQL
Amazon Aurora (MySQL), MySQL, PostgreSQL
If you want to convert a data warehouse schema, see
Getting Started Converting Data Warehouse
Schema with the AWS Schema Conversion Tool (p. 31)
.
Before You Begin
Before you complete the procedures in this topic, you must first do the following:
1. Create an AWS SCT project.
2. Connect to your source database.
3. Connect to your target database.
For more information, see
Getting Started with the AWS Schema Conversion Tool (p. 11)
.
Converting Your Schema
Use the following procedure to convert schema.
To convert schema
1. Choose View, and then choose Main View.
Version 1.0
23
AWS Schema Conversion Tool User Guide
Converting Your Schema
2. In the left panel that displays the schema from your source database, choose a schema object to convert. Open the context (right-click) menu for the object, and then choose Convert schema.
3. When AWS SCT finishes converting the schema, you can view the proposed schema in the panel on the right of your project.
At this point, no schema is applied to your target Amazon RDS DB instance. The planned schema is part of your project. If you select a converted schema item, you can see the planned schema command in the panel at lower center for your target Amazon RDS DB instance.
You can edit the schema in this window. The edited schema is stored as part of your project and is written to the target DB instance when you choose to apply your converted schema.
Version 1.0
24
AWS Schema Conversion Tool User Guide
The Database Migration Assessment Report
For more information, see
Converting Your Schema by Using the AWS Schema Conversion Tool (p. 71)
.
Creating and Reviewing the Database Migration
Assessment Report
The database migration assessment report summarizes all of the action items for schema that can't be converted automatically to the engine of your target Amazon RDS DB instance. The report also includes estimates of the amount of effort that it will take to write the equivalent code for your target
DB instance.
You can create (or update) a database migration assessment report in your project at any time by using the following procedure.
To create and view the database migration assessment report
1. In the left panel that displays the schema from your source database, choose a schema object to create an assessment report for. Open the context (right-click) menu for the object, and then choose
Create Report.
Version 1.0
25
AWS Schema Conversion Tool User Guide
The Database Migration Assessment Report
The assessment report view opens.
2. Choose the Action Items tab.
The Action Items tab displays a list of items that describe the schema that can't be converted automatically. Select one of the action items from the list. AWS SCT highlights the item from your schema that the action item applies to, as shown following.
Version 1.0
26
AWS Schema Conversion Tool User Guide
The Database Migration Assessment Report
3. Choose the Summary tab.
The Summary tab displays the summary information from the database migration assessment report. It shows the number of items that were converted automatically, and the number of items that were not converted automatically. The summary also includes an estimate of the time that it will take to create schema in your target DB instance that are equivalent to those in your source database.
The section License Evaluation and Cloud Support contains information about moving your existing on-premises database schema to an Amazon RDS DB instance running the same engine. For example, if you want to change license types, this section of the report tells you which features from your current database should be removed.
An example of an assessment report summary is shown following.
Version 1.0
27
AWS Schema Conversion Tool User Guide
The Database Migration Assessment Report
4. Choose the Summary tab, and then choose Save to PDF. The database migration assessment report is saved as a PDF file. The PDF file contains both the summary and action item information.
You can also choose Save to CSV to save the report as a comma-separated values (CSV) file. The CSV file contains only action item information.
Version 1.0
28
AWS Schema Conversion Tool User Guide
Applying the Converted Schema to Your Target DB Instance
For more information, see
Creating and Using the Assessment Report in the AWS Schema Conversion
Applying the Converted Schema to Your Target DB
Instance
You can apply the converted database schema to your target Amazon RDS DB instance. After the schema has been applied to your target DB instance, you can update the schema based on the action items in the database migration assessment report.
Warning
This procedure overwrites the existing target schema. Be careful not to overwrite schema unintentionally. Be careful not to overwrite schema in your target DB instance that you have already modified, or you will overwrite those changes.
Version 1.0
29
AWS Schema Conversion Tool User Guide
Related Topics
To apply the converted database schema to your target Amazon RDS DB instance
1. Choose the schema element in the right panel of your project that displays the planned schema for your target DB instance.
2. Open the context (right-click) menu for the schema element, and then choose Apply to database.
The converted schema is applied to the target DB instance.
For more information, see
Saving and Applying Your Converted Schema in the AWS Schema Conversion
Related Topics
•
Converting Database Schema to Amazon RDS by Using the AWS Schema Conversion Tool (p. 68)
Version 1.0
30
AWS Schema Conversion Tool User Guide
Getting Started Converting Data Warehouse Schema
Getting Started Converting Data Warehouse
Schema with the AWS Schema Conversion Tool
Following, you can find information to help you convert your data warehouse schema from one database engine to another by using the AWS Schema Conversion Tool (AWS SCT). You can use the converted schema with an Amazon Redshift cluster.
AWS SCT supports the following data warehouse conversions.
Source Database
Greenplum Database (version 4.3 and later)
Netezza (version 7.2 and later)
Oracle (version 11 and later)
Teradata (version 14 and later)
Target Database on Amazon Redshift
Amazon Redshift
Amazon Redshift
Amazon Redshift
Amazon Redshift
If you want to convert an online transaction processing (OLTP) database schema, see Getting Started
Converting Database Schema with the AWS Schema Conversion Tool (p. 23)
.
Before You Begin
Before you complete the procedures in this topic, you must first do the following:
1. Create an AWS SCT project.
2. Connect to your source database.
3. Connect to your target database.
For more information, see
Getting Started with the AWS Schema Conversion Tool (p. 11)
.
Choosing Optimization Strategies and Rules
To optimize how AWS SCT converts your data warehouse schema, you can choose the strategies and rules you want the tool to use. After converting your schema, and reviewing the suggested keys, you can adjust your rules or change your strategy to get the results you want.
To choose your optimization strategies and rules
1. Choose Settings, and then choose Project Settings. The Current project settings dialog box appears.
2. In the left pane, choose Optimization Strategies. The optimization strategies appear in the right pane with the defaults selected.
3. For Strategy Sector, choose the optimization strategy you want to use. You can choose from the following:
• Use metadata, ignore statistical information – In this strategy, only information from the metadata is used for optimization decisions. For example, if there is more than one index on a source table, the source database sort order is used, and the first index becomes a distribution key.
Version 1.0
31
AWS Schema Conversion Tool User Guide
Collecting or Uploading Statistics
• Ignore metadata, use statistical information – In this strategy, optimization decisions about derived from statistical information only. This strategy applies only to tables and columns for which statistics are provided. For more information, see
Collecting or Uploading Statistics for the
AWS Schema Conversion Tool (p. 90)
.
• Use metadata and use statistical information – In this strategy, both metadata and statistics are used for optimization decisions.
4. After you choose your optimization strategy, you can choose the rules you want to use. You can choose from the following:
•
Choose Distribution Key and Sort Keys using metadata
•
Choose fact table and appropriate dimension for collation
•
Analyze cardinality of indexes' columns
•
Find the most used tables and columns from QueryLog table
For each rule, you can enter a weight for the sort key and a weight for the distribution key. AWS SCT uses the weights you choose when it converts your schema.
For more information, see
Choosing Optimization Strategies and Rules for Use with the AWS Schema
Collecting or Uploading Statistics
To optimize how AWS SCT converts your data warehouse schema, you can provide statistics from your source database that the tool can use. You can either collect statistics directly from the database, or upload an existing statistics file.
To provide and review statistics
1. Connect to your source database. For more information, see
.
2. Choose a schema object from the left panel of your project, and open the context (right-click) menu for the object. Choose Collect Statistics or Upload Statistics as shown following.
3. Choose a schema object from the left panel of your project, and then choose the Statistics tab. You can review the statistics for the object.
Version 1.0
32
AWS Schema Conversion Tool User Guide
Converting Your Schema
For more information, see
Collecting or Uploading Statistics for the AWS Schema Conversion
Converting Your Schema
Use the following procedure to converted schema.
To convert schema
1. Choose View, and then choose Main View.
Version 1.0
33
AWS Schema Conversion Tool User Guide
Converting Your Schema
2. In the left panel that displays the schema from your source database, choose a schema object to convert. Open the context (right-click) menu for the object, and then choose Convert schema.
3. When AWS SCT finishes converting the schema, you can view the proposed schema in the panel on the right of your project.
At this point, no schema is applied to your target database. The planned schema is part of your project. If you select a converted schema item, you can see the planned schema command in the panel at lower center for your target database.
You can edit the schema in this window. The edited schema is stored as part of your project and is written to the target database when you choose to apply your converted schema.
Version 1.0
34
AWS Schema Conversion Tool User Guide
Managing and Customizing Keys
For more information, see
Converting Your Schema by Using the AWS Schema Conversion Tool (p. 93)
.
Managing and Customizing Keys
After you convert your schema, you can manage and edit your keys. Key management is the heart of a data warehouse conversion.
To manage keys, select a table in your target database, and then choose the Key Management tab as shown following.
Version 1.0
35
AWS Schema Conversion Tool User Guide
The Database Migration Assessment Report
The left pane contains key suggestions, and includes the confidence rating for each suggestion. You can choose one of the suggestions, or you can customize the key by editing it in the right pane.
If the choices for the key don't look like what you expected, you can edit your edit your optimization strategies, and then retry the conversion. For more information, see
Choosing Optimization Strategies and Rules (p. 31)
.
For more information, see
Managing and Customizing Keys in the AWS Schema Conversion
Creating and Reviewing the Database Migration
Assessment Report
The database migration assessment report summarizes all of the action items for schema that can't be converted automatically to the engine of your target database. The report also includes estimates of the amount of effort that it will take to write the equivalent code for your target database.
You can create (or update) a database migration assessment report in your project at any time by using the following procedure.
To create and view the database migration assessment report
1. In the left panel that displays the schema from your source database, choose a schema object to create an assessment report for. Open the context (right-click) menu for the object, and then choose
Create Report.
Version 1.0
36
AWS Schema Conversion Tool User Guide
The Database Migration Assessment Report
The assessment report view opens.
2. Choose the Action Items tab.
The Action Items tab displays a list of items that describe the schema that can't be converted automatically. Select one of the action items from the list. AWS SCT highlights the item from your schema that the action item applies to, as shown following.
Version 1.0
37
AWS Schema Conversion Tool User Guide
The Database Migration Assessment Report
3. Choose the Summary tab.
The Summary tab displays the summary information from the database migration assessment report. It shows the number of items that were converted automatically, and the number of items that were not converted automatically. The summary also includes an estimate of the time that it will take to create schema in your target database that are equivalent to those in your source database. An example is shown following.
Version 1.0
38
AWS Schema Conversion Tool User Guide
The Database Migration Assessment Report
4. Choose the Summary tab, and then choose Save to PDF. The database migration assessment report is saved as a PDF file. The PDF file contains both the summary and action item information.
You can also choose Save to CSV to save the report as a comma-separated values (CSV) file. The CSV file contains only action item information.
Version 1.0
39
AWS Schema Conversion Tool User Guide
Applying the Converted Schema to Your Target Database
For more information, see
Creating and Using the Assessment Report in the AWS Schema Conversion
Applying the Converted Schema to Your Target
Database
You can apply the converted database schema to your target database. After the schema has been applied to your target database, you can update the schema based on the action items in the database migration assessment report.
Warning
This procedure overwrites the existing target schema. Be careful not to overwrite schema unintentionally. Be careful not to overwrite schema in your target database that you have already modified, or you will overwrite those changes.
Version 1.0
40
AWS Schema Conversion Tool User Guide
Related Topics
To apply the converted database schema to your target database
1. Choose the schema element in the right panel of your project that displays the planned schema for your target database.
2. Open the context (right-click) menu for the schema element, and then choose Apply to database.
The converted schema is applied to the target database.
For more information, see
Saving and Applying Your Converted Schema in the AWS Schema Conversion
Related Topics
•
Converting Data Warehouse Schema to Amazon Redshift by Using the AWS Schema Conversion
Version 1.0
41
AWS Schema Conversion Tool User Guide
Connecting to an Amazon Redshift Source Database
Connecting to Your Source Database
Following, you can find information about how to connect to your source database. Choose the topic appropriate for your source database.
Topics
•
Connecting to an Amazon Redshift Source Database (p. 42)
•
Connecting to a Greenplum Source Database (p. 44)
•
Connecting to a Microsoft SQL Server Source Database (p. 46)
•
Connecting to a Microsoft SQL Server Data Warehouse Source Database (p. 48)
•
Connecting to a MySQL Source Database (p. 50)
•
Connecting to a Netezza Source Database (p. 52)
•
Connecting to an Oracle Source Database (p. 54)
•
Connecting to an Oracle Data Warehouse Source Database (p. 57)
•
Connecting to a PostgreSQL Source Database (p. 60)
•
Connecting to a Teradata Source Database (p. 62)
•
Connecting to a Vertica Source Database (p. 64)
Connecting to an Amazon Redshift Source
Database
Use the following procedure to connect to your Amazon Redshift source database with the AWS Schema
Conversion Tool (AWS SCT).
To connect to an Amazon Redshift source database
1. In the AWS Schema Conversion Tool, choose Connect to Source Amazon Redshift.
Version 1.0
42
AWS Schema Conversion Tool User Guide
Connecting to an Amazon Redshift Source Database
The Connect to Amazon Redshift dialog box appears.
2. Provide the Amazon Redshift source database connection information. Use the instructions in the following table.
For This Parameter
Server name
Server port
Database
User name and Password
Do This
Type the DNS name or IP address of your source database server.
Type the port used to connect to your source database server.
Type the name of the Amazon Redshift database.
Type the user name and password to connect to your source database server.
Note
AWS SCT uses the password to connect to your source database only when you create your project or choose the
Connect to
source
option in a project, where
source
is your source database. To guard against exposing the password for your source database, AWS SCT doesn't store the password. If you close your AWS SCT project and reopen it, you are prompted for the password to connect to your source database as needed.
Version 1.0
43
AWS Schema Conversion Tool User Guide
Related Topics
For This Parameter
Use SSL
Do This
Select this option if you want to use SSL to connect to your database. Provide the following additional information, as appropriate, on the SSL tab:
• Verify Server Certificate: Select this option to verify the server certificate by using a trust store.
• Trust Store: The location of a trust store containing certificates.
• Trust Store Password: The password for the trust store.
For more information about SSL support for Amazon Redshift, see Configure Security Options for Connections .
Amazon Redshift Driver Path
Type the path to the driver to use to connect to the source
database. For more information, see Installing the Required
.
If you store the driver path in the global project settings, the driver path doesn't appear on the connection dialog box.
For more information, see Storing Driver Paths in the Global
3. Choose Test Connection to verify that you can successfully connect to your source database.
4. Choose OK to connect to your source database.
Related Topics
•
Required Database Privileges for Using the AWS Schema Conversion Tool (p. 15)
•
Connecting to Your Target Database (p. 13)
Connecting to a Greenplum Source Database
Use the following procedure to connect to your Greenplum source database with the AWS Schema
Conversion Tool (AWS SCT).
To connect to a Greenplum source database
1. In the AWS Schema Conversion Tool, choose Connect to Greenplum.
The Connect to Greenplum dialog box appears.
Version 1.0
44
AWS Schema Conversion Tool User Guide
Connecting to a Greenplum Source Database
2. Provide the Greenplum source database connection information. Use the instructions in the following table.
For This Parameter
Server name
Server port
Database
User name and Password
Do This
Type the DNS name or IP address of your source database server.
Type the port used to connect to your source database server.
Type the name of the Greenplum database.
Type the user name and password to connect to your source database server.
Note
AWS SCT uses the password to connect to your source database only when you create your project or choose the
Connect to
source
option in a project, where
source
is your source database. To guard against exposing the password for your source database, AWS SCT doesn't store the password. If you close your AWS SCT project and reopen it, you are prompted for the password to connect to your source database as needed.
Version 1.0
45
AWS Schema Conversion Tool User Guide
Related Topics
For This Parameter
Use SSL
Greenplum Driver Path
Do This
Select this option if you want to use SSL to connect to your database. Provide the following additional information, as appropriate, on the SSL tab:
• Verify Server Certificate: Select this option to verify the server certificate by using a trust store.
• Trust Store: The location of a trust store containing certificates.
• Trust Store Password: The password for the trust store.
Type the path to the driver to use to connect to the source
database. For more information, see Installing the Required
.
If you store the driver path in the global project settings, the driver path doesn't appear on the connection dialog box.
For more information, see Storing Driver Paths in the Global
3. Choose Test Connection to verify that you can successfully connect to your source database.
4. Choose OK to connect to your source database.
Related Topics
•
Required Database Privileges for Using the AWS Schema Conversion Tool (p. 15)
•
Connecting to Your Target Database (p. 13)
Connecting to a Microsoft SQL Server Source
Database
Use the following procedure to connect to your Microsoft SQL Server source database with the AWS
Schema Conversion Tool (AWS SCT).
To connect to a Microsoft SQL Server source database
1. In the AWS Schema Conversion Tool, choose Connect to Microsoft SQL Server.
The Connect to Microsoft SQL Server dialog box appears.
Version 1.0
46
AWS Schema Conversion Tool User Guide
Connecting to a Microsoft SQL Server Source Database
2. Provide the Microsoft SQL Server source database connection information. Use the instructions in the following table.
For This Parameter
Server name
Server port
Instance name
User name and Password
Do This
Type the Domain Name Service (DNS) name or IP address of your source database server.
Type the port used to connect to your source database server.
Type the instance name for the SQL Server database. To find the instance name, run the query
SELECT @@servername;
on your
SQL Server database.
Type the user name and password to connect to your source database server.
Note
AWS SCT uses the password to connect to your source database only when you create your project or choose the
Connect to
source
option in a project, where
source
is your source database. To guard against exposing the password for your source database, AWS SCT doesn't store the password. If you close your AWS SCT project
Version 1.0
47
AWS Schema Conversion Tool User Guide
Related Topics
For This Parameter
Use SSL
Sql Server Driver Path
Do This
and reopen it, you are prompted for the password to connect to your source database as needed.
Select this option if you want to use Secure Sockets Layer (SSL) to connect to your database. Provide the following additional information, as appropriate, on the SSL tab:
• Trust Server Certificate: Select this option to trust the server certificate.
• Trust Store: The location of a trust store containing certificates.
• Trust Store Password: The password for the trust store.
Type the path to the driver to use to connect to the source
database. For more information, see Installing the Required
.
If you store the driver path in the global project settings, the driver path doesn't appear on the connection dialog box.
For more information, see Storing Driver Paths in the Global
3. Choose Test Connection to verify that you can successfully connect to your source database.
4. Choose OK to connect to your source database.
Related Topics
•
Required Database Privileges for Using the AWS Schema Conversion Tool (p. 15)
•
Connecting to Your Target Database (p. 13)
Connecting to a Microsoft SQL Server Data
Warehouse Source Database
Use the following procedure to connect to your Microsoft SQL Server data warehouse source database with the AWS Schema Conversion Tool (AWS SCT).
To connect to a Microsoft SQL Server data warehouse source database
1. In the AWS Schema Conversion Tool, choose Connect to Microsoft SQL Server DW.
The Connect to Microsoft SQL Server DW dialog box appears.
Version 1.0
48
AWS Schema Conversion Tool User Guide
Connecting to a Microsoft SQL Server
Data Warehouse Source Database
2. Provide the Microsoft SQL Server data warehouse source database connection information. Use the instructions in the following table.
For This Parameter
Server name
Server port
Instance name
User name and Password
Use SSL
Do This
Type the Domain Name Service (DNS) name or IP address of your source database server.
Type the port used to connect to your source database server.
Type the instance name for the SQL Server database. To find the instance name, run the query
SELECT @@servername;
on your
SQL Server database.
Type the user name and password to connect to your source database server.
Note
AWS SCT uses the password to connect to your source database only when you create your project or choose the
Connect to
source
option in a project, where
source
is your source database. To guard against exposing the password for your source database, AWS SCT doesn't store the password. If you close your AWS SCT project and reopen it, you are prompted for the password to connect to your source database as needed.
Select this option if you want to use Secure Sockets Layer (SSL) to connect to your database. Provide the following additional information, as appropriate, on the SSL tab:
Version 1.0
49
AWS Schema Conversion Tool User Guide
Related Topics
For This Parameter
Sql Server Driver Path
Do This
• Trust Server Certificate: Select this option to trust the server certificate.
• Trust Store: A trust store that you set up in the Global
Settings.
Type the path to the driver to use to connect to the source
database. For more information, see Installing the Required
.
If you store the driver path in the global project settings, the driver path doesn't appear on the connection dialog box.
For more information, see Storing Driver Paths in the Global
3. Choose Test Connection to verify that you can successfully connect to your source database.
4. Choose OK to connect to your source database.
Related Topics
•
Required Database Privileges for Using the AWS Schema Conversion Tool (p. 15)
•
Connecting to Your Target Database (p. 13)
Connecting to a MySQL Source Database
Use the following procedure to connect to your MySQL source database with the AWS Schema
Conversion Tool (AWS SCT).
To connect to a MySQL source database
1. In the AWS Schema Conversion Tool, choose Connect to MySQL.
The Connect to MySQL dialog box appears.
Version 1.0
50
AWS Schema Conversion Tool User Guide
Connecting to a MySQL Source Database
2. Provide the MySQL source database connection information. Use the instructions in the following table.
For This Parameter
Server name
Server port
User name and Password
Use SSL
Do This
Type the DNS name or IP address of your source database server.
Type the port used to connect to your source database server.
Type the user name and password to connect to your source database server.
Note
AWS SCT uses the password to connect to your source database only when you create your project or choose the
Connect to
source
option in a project, where
source
is your source database. To guard against exposing the password for your source database, AWS SCT doesn't store the password. If you close your AWS SCT project and reopen it, you are prompted for the password to connect to your source database as needed.
Select this option if you want to use SSL to connect to your database. Provide the following additional information, as appropriate, on the SSL tab:
Version 1.0
51
AWS Schema Conversion Tool User Guide
Related Topics
For This Parameter
MySql Driver Path
Do This
• Require SSL: Select this option if you want to connect to the server only through SSL.
Note
If you choose Require SSL, it means that if the server doesn't support SSL, you can't connect to the server.
If you don't choose Require SSL and the server doesn't support SSL, you can still connect to the server without using SSL. For more information, see
Using Secure Connections .
• Verify Server Certificate: Select this option to verify the server certificate by using a trust store.
• Trust Store: The location of a trust store containing certificates.
• Trust Store Password: The password for the trust store.
Type the path to the driver to use to connect to the source
database. For more information, see Installing the Required
.
If you store the driver path in the global project settings, the driver path doesn't appear on the connection dialog box.
For more information, see Storing Driver Paths in the Global
3. Choose Test Connection to verify that you can successfully connect to your source database.
4. Choose OK to connect to your source database.
Related Topics
•
Required Database Privileges for Using the AWS Schema Conversion Tool (p. 15)
•
Connecting to Your Target Database (p. 13)
Connecting to a Netezza Source Database
Use the following procedure to connect to your Netezza source database with the AWS Schema
Conversion Tool (AWS SCT).
To connect to a Netezza source database
1. In the AWS Schema Conversion Tool, choose Connect to Netezza.
The Connect to Netezza dialog box appears.
Version 1.0
52
AWS Schema Conversion Tool User Guide
Connecting to a Netezza Source Database
2. Provide the Netezza source database connection information. Use the instructions in the following table.
For This Parameter
Server name
Server port
User name and Password
Do This
Type the DNS name or IP address of your source database server.
Type the port used to connect to your source database server.
Type the user name and password to connect to your source database server.
Note
AWS SCT uses the password to connect to your source database only when you create your project or choose the
Connect to
source
option in a project, where
source
is your source database. To guard against exposing the password for your source database, AWS SCT doesn't store the password. If you close your AWS SCT project and reopen it, you are prompted for the password to connect to your source database as needed.
Netezza Driver Path
Type the path to the driver to use to connect to the source
database. For more information, see Installing the Required
.
If you store the driver path in the global project settings, the driver path doesn't appear on the connection dialog box.
For more information, see Storing Driver Paths in the Global
3. Choose Test Connection to verify that you can successfully connect to your source database.
Version 1.0
53
AWS Schema Conversion Tool User Guide
Related Topics
4. Choose OK to connect to your source database.
Related Topics
•
Required Database Privileges for Using the AWS Schema Conversion Tool (p. 15)
•
Connecting to Your Target Database (p. 13)
Connecting to an Oracle Source Database
Use the following procedure to connect to your Oracle source database with the AWS Schema
Conversion Tool (AWS SCT).
To connect to an Oracle source database
1. In the AWS Schema Conversion Tool, choose Connect to Oracle.
The Connect to Oracle dialog box appears.
Version 1.0
54
AWS Schema Conversion Tool User Guide
Connecting to an Oracle Source Database
2. Provide the Oracle source database connection information. Use the instructions in the following table.
For This Parameter
Type
Do This
Choose the connection type to your database. Depending on your type, provide the following additional information:
•
SID
• Server name: The DNS name or IP address of your source database server.
• Server port: The port used to connect to your source database server.
• Oracle SID: The Oracle System ID (SID). To find the Oracle
SID, submit the following query to your Oracle database:
SELECT sys_context('userenv','instance_name') AS SID
FROM dual;
Version 1.0
55
For This Parameter
Use SSL
AWS Schema Conversion Tool User Guide
Connecting to an Oracle Source Database
User name and Password
Do This
•
Service Name
•
Server name: The DNS name or IP address of your source database server.
• Server port: The port used to connect to your source database server.
• Service Name: The name of the Oracle service to connect to.
•
TNS Alias
• TNS file path: The path to the file that contains the
Transparent Network Substrate (TNS) name connection information.
• TNS file path: The TNS alias from this file to use to connect to the source database.
•
TNS Connect Identifier
• TNS identifier: The identifier for the registered TNS connection information.
Type the user name and password to connect to your source database server.
Note
AWS SCT uses the password to connect to your source database only when you create your project or choose the
Connect to
source
option in a project, where
source
is your source database. To guard against exposing the password for your source database, AWS SCT doesn't store the password. If you close your AWS SCT project and reopen it, you are prompted for the password to connect to your source database as needed.
Select this option if you want to use SSL to connect to your database. Provide the following additional information, as appropriate, on the SSL tab:
• SSL Authentication: Select this option to use SSL authentication for the connection.
• Trust Store: The location of a trust store containing certificates.
• Trust Store Password: The password for the trust store.
• Key Store: The location of a key store containing a private key and certificates. This value is required if SSL Authentication is selected and is otherwise optional.
• Trust Store Password: The password for the key store. This value is required if SSL Authentication is selected and is otherwise optional.
Version 1.0
56
AWS Schema Conversion Tool User Guide
Related Topics
For This Parameter
Oracle Driver Path
Do This
Type the path to the driver to use to connect to the source
database. For more information, see Installing the Required
.
If you store the driver path in the global project settings, the driver path doesn't appear on the connection dialog box.
For more information, see Storing Driver Paths in the Global
3. Choose Test Connection to verify that you can successfully connect to your source database.
4. Choose OK to connect to your source database.
Related Topics
•
Required Database Privileges for Using the AWS Schema Conversion Tool (p. 15)
•
Connecting to Your Target Database (p. 13)
Connecting to an Oracle Data Warehouse Source
Database
Use the following procedure to connect to your Oracle data warehouse source database with the AWS
Schema Conversion Tool (AWS SCT).
To connect to an Oracle data warehouse source database
1. In the AWS Schema Conversion Tool, choose Connect to Oracle DW.
The Connect to Oracle dialog box appears.
Version 1.0
57
AWS Schema Conversion Tool User Guide
Connecting to an Oracle Data Warehouse Source Database
2. Provide the Oracle Data Warehouse source database connection information. Use the instructions in the following table.
For This Parameter
Type
Do This
Choose the connection type to your database. Depending on your type, provide the following additional information:
•
SID
• Server name: The DNS name or IP address of your source database server.
• Server port: The port used to connect to your source database server.
• Oracle SID: The Oracle System ID (SID). To find the Oracle
SID, submit the following query to your Oracle database:
SELECT sys_context('userenv','instance_name') AS SID
FROM dual;
Version 1.0
58
AWS Schema Conversion Tool User Guide
Connecting to an Oracle Data Warehouse Source Database
For This Parameter
User name and Password
Use SSL
Do This
•
Service Name
•
Server name: The DNS name or IP address of your source database server.
• Server port: The port used to connect to your source database server.
• Service Name: The name of the Oracle service to connect to.
•
TNS Alias
• TNS file path: The path to the file that contains the
Transparent Network Substrate (TNS) name connection information.
• TNS file path: The TNS alias from this file to use to connect to the source database.
•
TNS Connect Identifier
• TNS identifier: The identifier for the registered TNS connection information.
Type the user name and password to connect to your source database server.
Note
AWS SCT uses the password to connect to your source database only when you create your project or choose the
Connect to
source
option in a project, where
source
is your source database. To guard against exposing the password for your source database, AWS SCT doesn't store the password. If you close your AWS SCT project and reopen it, you are prompted for the password to connect to your source database as needed.
Select this option if you want to use SSL to connect to your database. Provide the following additional information, as appropriate, on the SSL tab:
• SSL Authentication: Select this option to use SSL authentication for the connection.
• Trust Store: The location of a trust store containing certificates.
• Trust Store Password: The password for the trust store.
• Key Store: The location of a key store containing a private key and certificates. This value is required if SSL Authentication is selected and is otherwise optional.
• Trust Store Password: The password for the key store. This value is required if SSL Authentication is selected and is otherwise optional.
Version 1.0
59
AWS Schema Conversion Tool User Guide
Related Topics
For This Parameter
Oracle Driver Path
Do This
Type the path to the driver to use to connect to the source
database. For more information, see Installing the Required
.
If you store the driver path in the global project settings, the driver path doesn't appear on the connection dialog box.
For more information, see Storing Driver Paths in the Global
3. Choose Test Connection to verify that you can successfully connect to your source database.
4. Choose OK to connect to your source database.
Related Topics
•
Required Database Privileges for Using the AWS Schema Conversion Tool (p. 15)
•
Connecting to Your Target Database (p. 13)
Connecting to a PostgreSQL Source Database
Use the following procedure to connect to your PostgreSQL source database with the AWS Schema
Conversion Tool (AWS SCT).
To connect to a PostgreSQL source database
1. In the AWS Schema Conversion Tool, choose Connect to PostgreSQL.
The Connect to PostgreSQL dialog box appears.
Version 1.0
60
AWS Schema Conversion Tool User Guide
Connecting to a PostgreSQL Source Database
2. Provide the PostgreSQL source database connection information. Use the instructions in the following table.
For This Parameter
Server name
Server port
Database
User name and Password
Do This
Type the DNS name or IP address of your source database server.
Type the port used to connect to your source database server.
Type the name of the PostgreSQL database.
Type the user name and password to connect to your source database server.
Note
AWS SCT uses the password to connect to your source database only when you create your project or choose the
Connect to
source
option in a project, where
source
is your source database. To guard against exposing the password for your source database, AWS SCT doesn't store the password. If you close your AWS SCT project and reopen it, you are prompted for the password to connect to your source database as needed.
Version 1.0
61
AWS Schema Conversion Tool User Guide
Related Topics
For This Parameter
Use SSL
PostgreSQL Driver Path
Do This
Select this option if you want to use SSL to connect to your database. Provide the following additional information, as appropriate, on the SSL tab:
• Verify Server Certificate: Select this option to verify the server certificate by using a trust store.
• Trust Store: The location of a trust store containing certificates.
• Trust Store Password: The password for the trust store.
Type the path to the driver to use to connect to the source
database. For more information, see Installing the Required
.
If you store the driver path in the global project settings, the driver path doesn't appear on the connection dialog box.
For more information, see Storing Driver Paths in the Global
3. Choose Test Connection to verify that you can successfully connect to your source database.
4. Choose OK to connect to your source database.
Related Topics
•
Required Database Privileges for Using the AWS Schema Conversion Tool (p. 15)
•
Connecting to Your Target Database (p. 13)
Connecting to a Teradata Source Database
Use the following procedure to connect to your Teradata source database with the AWS Schema
Conversion Tool (AWS SCT).
To connect to a Teradata source database
1. In the AWS Schema Conversion Tool, choose Connect to Teradata.
The
Connect to Teradata dialog box appears.
Version 1.0
62
AWS Schema Conversion Tool User Guide
Connecting to a Teradata Source Database
2. Provide the Teradata source database connection information. Use the instructions in the following table.
For This Parameter
Server name
Server port
Database
User name and Password
Do This
Type the DNS name or IP address of your source database server.
Type the port used to connect to your source database server.
Type the name of the Teradata database.
Type the user name and password to connect to your source database server.
Note
AWS SCT uses the password to connect to your source database only when you create your project or choose the
Connect to
source
option in a project, where
source
is your source database. To guard against exposing the password for your source database, AWS SCT doesn't store the password. If you close your AWS SCT project and reopen it, you are prompted for the password to connect to your source database as needed.
Version 1.0
63
AWS Schema Conversion Tool User Guide
Related Topics
For This Parameter
Encrypt Data
Teradata Driver Path
Do This
Select this option if you want to encrypt data that you exchange with the database.
Type the path to the driver to use to connect to the source
database. For more information, see Installing the Required
.
If you store the driver path in the global project settings, the driver path doesn't appear on the connection dialog box.
For more information, see Storing Driver Paths in the Global
3. Choose Test Connection to verify that you can successfully connect to your source database.
4. Choose OK to connect to your source database.
Related Topics
•
Required Database Privileges for Using the AWS Schema Conversion Tool (p. 15)
•
Connecting to Your Target Database (p. 13)
Connecting to a Vertica Source Database
Use the following procedure to connect to your Vertica source database with the AWS Schema
Conversion Tool (AWS SCT).
To connect to a Vertica source database
1. In the AWS Schema Conversion Tool, choose Connect to Vertica.
The Connect to Vertica dialog box appears.
Version 1.0
64
AWS Schema Conversion Tool User Guide
Connecting to a Vertica Source Database
2. Provide the Vertica source database connection information. Use the instructions in the following table.
For This Parameter
Server name
Server port
Database
User name and Password
Use SSL
Do This
Type the DNS name or IP address of your source database server.
Type the port used to connect to your source database server.
Type the name of the Vertica database.
Type the user name and password to connect to your source database server.
Note
AWS SCT uses the password to connect to your source database only when you create your project or choose the
Connect to
source
option in a project, where
source
is your source database. To guard against exposing the password for your source database, AWS SCT doesn't store the password. If you close your AWS SCT project and reopen it, you are prompted for the password to connect to your source database as needed.
Select this option if you want to use SSL to connect to your database. Provide the following additional information, as appropriate, on the SSL tab:
Version 1.0
65
AWS Schema Conversion Tool User Guide
Related Topics
For This Parameter
Vertica Driver Path
Do This
• Trust Store: A trust store that you set up in the Global
Settings.
• Key Store: A key store that you set up in the Global Settings.
Type the path to the driver to use to connect to the source
database. For more information, see Installing the Required
.
If you store the driver path in the global project settings, the driver path doesn't appear on the connection dialog box.
For more information, see Storing Driver Paths in the Global
3. Choose Test Connection to verify that you can successfully connect to your source database.
4. Choose OK to connect to your source database.
Related Topics
•
Required Database Privileges for Using the AWS Schema Conversion Tool (p. 15)
•
Connecting to Your Target Database (p. 13)
Version 1.0
66
AWS Schema Conversion Tool User Guide
Working with Databases
You can use the AWS Schema Conversion Tool (AWS SCT) to convert your existing database schema from one database engine to another. Your converted schema is suitable for Amazon Relational Database
Service (Amazon RDS).
You can also use AWS SCT to copy your existing on-premises database schema to an Amazon RDS DB instance running the same engine. You can use this feature to analyze potential cost savings of moving to the cloud and of changing your license type.
In some cases, database features can't be converted to equivalent Amazon RDS features. If you host and self-manage a database on the Amazon Elastic Compute Cloud (Amazon EC2) platform, you can emulate these features by substituting AWS services for them.
Following, you can find more information about these processes.
Topics
•
Converting Database Schema to Amazon RDS by Using the AWS Schema Conversion Tool (p. 68)
•
The AWS Schema Conversion Tool Extension Pack and AWS Services for Databases (p. 84)
Version 1.0
67
AWS Schema Conversion Tool User Guide
Converting Database Schema
Converting Database Schema to Amazon RDS by
Using the AWS Schema Conversion Tool
The AWS Schema Conversion Tool (AWS SCT) automates much of the process of converting your online transaction processing (OLTP) database schema to an Amazon Relational Database Service (Amazon
RDS) MySQL DB instance, an Amazon Aurora DB cluster, or a PostgreSQL DB instance. The source and target database engines contain many different features and capabilities, and AWS SCT attempts to create an equivalent schema in your Amazon RDS DB instance wherever possible. If no direct conversion is possible, AWS SCT provides a list of possible actions for you to take.
You can also use AWS SCT to copy your existing on-premises database schema to an Amazon RDS DB instance running the same engine. You can use this feature to analyze potential cost savings of moving to the cloud.
AWS SCT supports the following OLTP conversions.
Source Database
Microsoft SQL Server (version 2008 and later)
MySQL (version 5.6 and later)
Oracle (version 10.2 and later)
PostgreSQL (version 9.1 and later)
Target Database on Amazon RDS
Amazon Aurora (MySQL or PostgreSQL), Microsoft
SQL Server, MySQL, PostgreSQL
Amazon Aurora (PostgreSQL), MySQL, PostgreSQL
Amazon Aurora (MySQL or PostgreSQL), MySQL,
Oracle, PostgreSQL
Amazon Aurora (MySQL), MySQL, PostgreSQL
If you want to convert a data warehouse schema, see
Converting Data Warehouse Schema to Amazon
Redshift by Using the AWS Schema Conversion Tool (p. 87)
.
Almost all work you do with AWS SCT starts with the following three steps:
1. Create an AWS SCT project.
2. Connect to your source database.
3. Connect to your target database.
If you have not created an AWS SCT project yet, see
Getting Started with the AWS Schema Conversion
To convert your database schema to Amazon RDS, you take the following high-level steps:
• Create mapping rules – Before you convert your schema with AWS SCT, you can set up rules that change the data type of columns, move objects from one schema to another, and change the names of objects.
For more information, see
Creating Mapping Rules in the AWS Schema Conversion Tool (p. 69)
.
• Convert your schema – AWS SCT creates a local version of the converted schema for you to review, but it doesn't apply it to your target DB instance until you are ready.
For more information, see
Converting Your Schema by Using the AWS Schema Conversion
Version 1.0
68
AWS Schema Conversion Tool User Guide
Creating Mapping Rules
• Create a database migration assessment report – AWS SCT creates a database migration assessment report that details the schema elements that can't be converted automatically. You can use this report to identify where you need to create a schema in your Amazon RDS DB instance that is compatible with your source database.
For more information, see
Creating and Using the Assessment Report in the AWS Schema Conversion
• Decide how to handle manual conversions – If you have schema elements that can't be converted automatically, you have 2 choices: update the source schema and then convert again, or create equivalent schema elements in your target Amazon RDS DB instance.
For more information, see
Handling Manual Conversions in the AWS Schema Conversion
• Update and refresh the schema in your AWS SCT project – You can update your AWS SCT project with the most recent schema from your source database.
For more information, see
Updating and Refreshing Your Converted Schema in the AWS Schema
.
• Apply the converted schema to your target database – When you are ready, have AWS SCT apply the converted schema in your local project to your target Amazon RDS DB instance.
For more information, see
Saving and Applying Your Converted Schema in the AWS Schema
.
Creating Mapping Rules in the AWS Schema
Conversion Tool
Before you convert your schema with the AWS Schema Conversion Tool (AWS SCT), you can set up rules that change the data type of columns, move objects from one schema to another, and change the names of objects. For example, if you have a set of tables in your source schema named test_TABLE_NAME
, you can set up a rule that changes the prefix test_
to the prefix demo_
in the target schema.
Note
You can only create mapping rules if your source database engine and target database engine are different.
You can create mapping rules that perform the following tasks:
• Change data type
• Move objects
• Rename objects
• Prefix - add prefix, remove prefix, replace prefix
• Suffix - add suffix, remove suffix, replace suffix
You can create mapping rules for the following objects:
Version 1.0
69
AWS Schema Conversion Tool User Guide
Creating Mapping Rules
• Database
• Schema
• Table
• Column
Creating Mapping Rules
You can create mapping rules and save the rules as part of your project. With your project open, use the following procedure to create mapping rules.
To create mapping rules
1. Choose Mapping Rules from the Settings menu. The Mapping Rules dialog box appears.
2. Choose Add new rule. A new row is added to the list of rules.
3. Choose the edit icon to configure your rule.
a. For Name, type a name for your rule.
b. For For, choose the type of object that the rule applies to.
c.
For where, type a filter to apply to objects before applying the mapping rule. The where clause is evaluated by using a like clause. You can enter an exact name to select one object, or you can enter a pattern to select multiple objects.
The fields available for the where clause are different depending on the type of the object. For example, if the object type is schema there is only one field available, for the schema name.
d. For Actions, choose the type of mapping rule you want to create.
e. Depending on the rule type, type one or two additional values. For example, to rename an object, type the new name of the object. To replace a prefix, type the old prefix and the new prefix.
4. After you have configured your mapping rule, choose Save to save your rule. You can also choose
Cancel to cancel your changes.
5. After you are done adding, editing, and deleting rules, choose Save All to save all your changes.
6. Choose Close to close the Mapping Rules dialog box.
Version 1.0
70
AWS Schema Conversion Tool User Guide
Converting Your Schema
You can use the toggle icon to turn off a mapping rule without deleting it. You can use the copy icon to duplicate an existing mapping rule. You can use the delete icon to delete an existing mapping rule. To save any changes you make to your mapping rules, choose Save All.
Viewing Mapping Rules for Objects
After you set up your mapping rules, you can view the effect of the rules on specific objects in your schema before you convert your schema. In the source schema tree, choose the object you are interested in. In the main view, choose the Mapping tab. The Mapping tab opens and displays a list of all mapping rules that are applied to the object. You can see the name of the object in the source schema and the new name of the object in the target schema. If you have data type rules, you also see the data type of the column in the source schema and the new data type of the column in the target schema.
Exporting Mapping Rules
If you use AWS Database Migration Service (AWS DMS) to migrate your data from your source database to your target database, you can provide information about your mapping rules to AWS DMS. For more information about tasks, see Working with AWS Database Migration Service Replication Tasks .
To export mapping rules
1. In the AWS Schema Conversion Tool, in the source schema tree, open the context (right-click) menu and choose Export script for DMS. The save dialog box opens.
2. Browse to the location where you want to save your script, and then choose Save. Your mapping rules are saved as a JSON script that can be consumed by AWS DMS.
Converting Your Schema by Using the AWS Schema
Conversion Tool
After you have connected your project to both your source database and your target Amazon RDS DB instance, your AWS Schema Conversion Tool (AWS SCT) project displays the schema from your source database in the left panel. The schema is presented in a tree-view format, and each node of the tree is lazy loaded. When you choose a node in the tree view, AWS SCT requests the schema information from your source database at that time.
You can choose schema items from your source database and then convert the schema to equivalent schema for the DB engine of your target DB instance. You can choose any schema item from your source database to convert. If the schema item that you choose depends on a parent item, then AWS SCT also generates the schema for the parent item. For example, if you choose a column from a table to convert, then AWS SCT generates the schema for the column, the table that the column is in, and the database that the table is in.
Converting Schema
To convert schema from your source database, choose a schema object to convert from the left panel of your project. Open the context (right-click) menu for the object, and then choose Convert schema, as shown following.
Version 1.0
71
AWS Schema Conversion Tool User Guide
Converting Your Schema
After you have converted the schema from your source database, you can choose schema items from the left panel of your project and view the converted schema in the center panels of your project. The lowercenter panel displays the properties of and the SQL command to create the converted schema, as shown following.
Version 1.0
72
AWS Schema Conversion Tool User Guide
Converting Your Schema
After you have converted your schema, you can save your project. The schema information from your source database is saved with your project. This functionality means that you can work offline without being connected to your source database. AWS SCT connects to your source database to update the schema in your project if you choose
Refresh from Database for your source database. For more information, see
Updating and Refreshing Your Converted Schema in the AWS Schema Conversion
You can create a database migration assessment report of the items that can't be converted automatically. The assessment report is useful for identifying and resolving schema items that can't be converted automatically. For more information, see
Creating and Using the Assessment Report in the
AWS Schema Conversion Tool (p. 75) .
When AWS SCT generates a converted schema, it doesn't immediately apply it to the target DB instance.
Instead, the converted schema is stored locally until you are ready to apply it to the target DB instance.
For more information, see
Applying Your Converted Schema (p. 82) .
Editing Converted Schema
You can edit converted schema and save the changes as part of your project.
To edit converted schema
1. In the left panel that displays the schema from your source database, choose the schema item that you want to edit the converted schema for.
Version 1.0
73
AWS Schema Conversion Tool User Guide
Converting Your Schema
2. In the lower-center panel that displays the converted schema for the selected item, choose the
SQL
tab.
3. In the text displayed for the SQL tab, change the schema as needed. The schema is automatically saved with your project as you update it.
The changes that you make to converted schema are stored with your project as you make updates. If you newly convert a schema item from your source database, and you have made updates to previously converted schema for that item, those existing updates are replaced by the newly converted schema item based on your source database.
Clearing a Converted Schema
Until you apply the schema to your target DB instance, AWS SCT only stores the converted schema locally in your project. You can clear the planned schema from your project by choosing the tree-view node for your target DB instance, and then choosing Refresh from Database. Because no schema has been written to your target DB instance, refreshing from the database removes the planned schema elements in your AWS SCT project to match what exists in your target DB instance.
Version 1.0
74
AWS Schema Conversion Tool User Guide
Creating and Using the Assessment Report
Creating and Using the Assessment Report in the
AWS Schema Conversion Tool
The AWS Schema Conversion Tool (AWS SCT) creates a database migration assessment report to help you convert your schema. The database migration assessment report provides important information about the conversion of the schema from your source database to your target Amazon RDS DB instance.
The report summarizes all of the schema conversion tasks and details the action items for schema that can't be converted to the DB engine of your target DB instance. The report also includes estimates of the amount of effort that it will take to write the equivalent code in your target DB instance that can't be converted automatically.
If you are using AWS SCT to copy your existing on-premises database schema to an Amazon RDS DB instance running the same engine, the report can help you analyze requirements for moving to the cloud and for changing your license type.
Creating a Database Migration Assessment Report
Use the following procedure to create a database migration assessment report.
Version 1.0
75
AWS Schema Conversion Tool User Guide
Creating and Using the Assessment Report
To create a database migration assessment report
1. In the left panel that displays the schema from your source database, choose a schema object to create an assessment report for.
2. Open the context (right-click) menu for the object, and then choose Create Report.
Assessment Report Summary
After you create an assessment report, the assessment report view opens, showing the Summary tab.
The Summary tab displays the summary information from the database migration assessment report. It shows items that were converted automatically, and items that were not converted automatically.
Version 1.0
76
AWS Schema Conversion Tool User Guide
Creating and Using the Assessment Report
For schema items that can't be converted automatically to the target database engine, the summary includes an estimate of the effort that it takes to create schema items in your target DB instance that are equivalent to those in your source database.
The report categorizes the estimated time to convert these schema items as follows:
• Simple – Actions that can be completed in less than 1 hour.
• Medium – Actions that are more complex and can be completed in 1 to 4 hours.
• Significant – Actions that are very complex and take more than 4 hours to complete.
The section License Evaluation and Cloud Support contains information about moving your existing on-premises database schema to an Amazon RDS DB instance running the same engine. For example, if you want to change license types, this section of the report tells you which features from your current database should be removed.
Assessment Report Action Items
The assessment report view also includes an Action Items tab. This tab contains a list of items that can't be converted automatically to the database engine of your target Amazon RDS DB instance. If you select an action item from the list, AWS SCT highlights the item from your schema that the action item applies to.
The report also contains recommendations for how to manually convert the schema item. For more
information about deciding how to handle manual conversions, see Handling Manual Conversions in the
AWS Schema Conversion Tool (p. 79) .
Version 1.0
77
AWS Schema Conversion Tool User Guide
Creating and Using the Assessment Report
Saving the Assessment Report
You can save a local copy of the database migration assessment report as either a PDF file or a commaseparated values (CSV) file. The CSV file contains only action item information. The PDF file contains both the summary and action item information, as shown in the following example.
Version 1.0
78
AWS Schema Conversion Tool User Guide
Handling Manual Conversions
Handling Manual Conversions in the AWS Schema
Conversion Tool
The assessment report includes a list of items that can't be converted automatically to the database engine of your target Amazon RDS DB instance. For each item that can't be converted, there is an action item on the Action Items tab.
You can respond to the action items in the assessment report in the following ways:
• Modify your source database schema.
• Modify your target database schema.
Version 1.0
79
AWS Schema Conversion Tool User Guide
Updating and Refreshing Your Converted Schema
Modifying Your Source Schema
For some items, it might be easier to modify the database schema in your source database to schema that can be converted automatically. First, verify that the new changes are compatible with your application architecture, then update the schema in your source database. Finally, refresh your project with the updated schema information. You can then convert your updated schema, and generate a new database migration assessment report. The action items no longer appear for the items that changed in the source schema.
The advantage of this process is that your updated schema is always available when you refresh from your source database.
Modifying Your Target Schema
For some items, it might be easier to apply the converted schema to your target database, and then add equivalent schema items manually to your target database for the items that couldn't be converted automatically. You can write all of the schema that can be converted automatically to your target
DB instance by applying the schema. For more information, see
Saving and Applying Your Converted
Schema in the AWS Schema Conversion Tool (p. 81)
.
The schema that are written to your target DB instance don't contain the items that can't be converted automatically. After applying the schema to your target DB instance, you can then manually create schema in your target DB instance that are equivalent to those in the source database. The action items in the database migration assessment report contain suggestions for how to create the equivalent schema.
Warning
If you manually create schema in your target DB instance, save a copy of any manual work that you do. If you apply the converted schema from your project to your target DB instance again, it overwrites the manual work you have done.
In some cases, you can't create equivalent schema in your target DB instance. You might need to rearchitect a portion of your application and database to use the functionality that is available from the
DB engine for your target DB instance. In other cases, you can simply ignore the schema that can't be converted automatically.
Related Topics
•
Converting Your Schema by Using the AWS Schema Conversion Tool (p. 71)
•
Creating and Using the Assessment Report in the AWS Schema Conversion Tool (p. 75)
•
Updating and Refreshing Your Converted Schema in the AWS Schema Conversion Tool (p. 80)
Updating and Refreshing Your Converted Schema in the AWS Schema Conversion Tool
You can update both the source schema and the target schema in your AWS Schema Conversion Tool
(AWS SCT) project.
• Source – If you update the schema for your source database, AWS SCT replaces the schema in your project with the latest schema from your source database. Using this functionality, you can update your project if changes have been made to the schema of your source database.
•
Target – If you update the schema for your target Amazon RDS DB instance, AWS SCT replaces the schema in your project with the latest schema from your target DB instance. If you haven't applied any
Version 1.0
80
AWS Schema Conversion Tool User Guide
Saving and Applying Your Schema
schema to your target DB instance, AWS SCT clears the converted schema from your project. You can then convert the schema from your source database for a clean target DB instance.
You update the schema in your AWS SCT project by choosing Refresh from Database, as shown following.
Saving and Applying Your Converted Schema in the
AWS Schema Conversion Tool
When the AWS Schema Conversion Tool (AWS SCT) generates converted schema (as shown in
Your Schema by Using the AWS Schema Conversion Tool (p. 71) ), it doesn't immediately apply the
converted schema to the target DB instance. Instead, converted schema are stored locally in your project until you are ready to apply them to the target DB instance. Using this functionality, you can work with schema items that can't be converted automatically to your target DB engine. For more information on
items that can't be converted automatically, see Creating and Using the Assessment Report in the AWS
Schema Conversion Tool (p. 75)
.
You can optionally have the tool save your converted schema to a file as a SQL script prior to applying the schema to your target DB instance. You can also have the tool apply the converted schema directly to your target DB instance.
Saving Your Converted Schema to a File
You can save your converted schema as SQL scripts in a text file. By using this approach, you can modify the generated SQL scripts from AWS SCT to address items that the tool can't convert automatically. You
Version 1.0
81
AWS Schema Conversion Tool User Guide
Saving and Applying Your Schema can then run your updated scripts on your target DB instance to apply your converted schema to your target database.
To save your converted schema as SQL scripts, open the context (right-click) menu for the schema element, and choose Save as SQL, as shown following.
Applying Your Converted Schema
When you are ready to apply your converted schema to your target Amazon RDS DB instance, choose the schema element from the right panel of your project. Open the context (right-click) menu for the schema element, and then choose Apply to database, as shown following.
Version 1.0
82
AWS Schema Conversion Tool User Guide
Saving and Applying Your Schema
The Extension Pack Schema
The first time that you apply your converted schema to your target DB instance, AWS SCT adds an additional schema to your target DB instance. This schema implements system functions of the source database that are required when writing your converted schema to your target DB instance. The schema is called the extension pack schema.
Don't modify the extension pack schema, or you might encounter unexpected results in the converted schema that is written to your target DB instance. When your schema is fully migrated to your target DB instance, and you no longer need AWS SCT, you can delete the extension pack schema.
The extension pack schema is named according to your source database as follows:
• Microsoft SQL Server:
AWS_SQLSERVER_EXT
• MySQL:
AWS_MYSQL_EXT
• Oracle:
AWS_ORACLE_EXT
• PostgreSQL:
AWS_POSTGRESQL_EXT
For more information, see
The AWS Schema Conversion Tool Extension Pack and AWS Services for
Version 1.0
83
AWS Schema Conversion Tool User Guide
The Extension Pack and AWS Services for Databases
The AWS Schema Conversion Tool Extension Pack and AWS Services for Databases
When you convert your database schema, the AWS Schema Conversion Tool (AWS SCT) adds an additional schema to your target DB instance. This schema implements system functions of the source database that are required when writing your converted schema to your target DB instance. The schema is called the extension pack schema.
The extension pack schema is named according to your source database as follows:
• Microsoft SQL Server:
AWS_SQLSERVER_EXT
• MySQL:
AWS_MYSQL_EXT
• Oracle:
AWS_ORACLE_EXT
• PostgreSQL:
AWS_POSTGRESQL_EXT
In two cases, you might want to install the extension pack manually:
• You accidentally delete the extension pack database schema from your target database.
• You want to use AWS services to emulate database functionality.
Using AWS Services to Emulate Database
Functionality
In some cases, database features can't be converted to equivalent Amazon Relational Database Service
(Amazon RDS) features. Some examples are Oracle send email calls that use
UTL_SMTP
, and Microsoft
SQL Server jobs that use a job scheduler. If you host and self-manage a database on the Amazon Elastic
Compute Cloud (Amazon EC2) platform, you can emulate these features by substituting AWS services for them.
The AWS SCT extension pack wizard helps you install, create, and configure AWS Lambda functions to emulate email, job scheduling, and other features.
Before You Begin
Almost all work you do with the AWS SCT starts with the following three steps:
1. Create an AWS SCT project.
2. Connect to your source database.
3. Connect to your target database.
If you have not created an AWS SCT project yet, see
Getting Started with the AWS Schema Conversion
Before you install the extension pack, you need to convert your database schema. For more information,
see Converting Database Schema to Amazon RDS by Using the AWS Schema Conversion Tool (p. 68) .
Applying the Extension Pack
Use the following procedure to apply the extension pack.
Version 1.0
84
AWS Schema Conversion Tool User Guide
Applying the Extension Pack
Important
The AWS service emulation features are supported only for databases installed and selfmanaged on the Amazon EC2 platform. Don't install the service emulation features if your target database is on an Amazon RDS DB instance.
To apply the extension pack
1. In the AWS Schema Conversion Tool, in the target database tree, open the context (right-click) menu, and choose Apply Extension Pack.
The extension pack wizard appears.
2. Read the Welcome page, and then choose Next.
3. On the AWS Services Settings page, do the following:
• If you are reinstalling the extension pack database schema only, choose Skip this step for now, and then choose Next.
• If you are installing AWS services, provide the credentials to connect to your AWS account. You can use your AWS Command Line Interface (AWS CLI) credentials if you have the AWS CLI installed.
You can also use credentials that you previously stored in a profile in the global application settings and associated with the project. If necessary, choose Navigate to Project Settings to associate a different profile with the project. If necessary, choose Global Settings to create a new profile. For more information, see
Storing AWS Profiles in the AWS Schema Conversion
.
4. On the Email Sending Service page, do the following:
• If you are reinstalling the extension pack database schema only, choose Skip this step for now, and then choose Next.
• If you are installing AWS services and you have an existing AWS Lambda function, you can provide it. Otherwise the wizard creates it for you. When you are done, choose Next.
5. On the Job Emulation Service page, do the following:
• If you are reinstalling the extension pack database schema only, choose Skip this step for now, and then choose Next.
• If you are installing AWS services and you have an existing AWS Lambda function, you can provide it. Otherwise the wizard creates it for you. When you are done, choose Next.
6. On the Functions Emulation page, choose Create Extension Pack. Messages appear with the status of the extension pack operations. When you are done, choose Finish.
Version 1.0
85
AWS Schema Conversion Tool User Guide
Working with Data Warehouses
You can use the AWS Schema Conversion Tool (AWS SCT) to convert your existing data warehouse schema. Your converted schema is suitable for an Amazon Redshift cluster.
In some cases, source database features can't be converted to equivalent Amazon Redshift features.
The AWS SCT extension pack contains a custom Python library that emulates some source database functionality on Amazon Redshift.
You can use data extraction agents to extract data from your data warehouse to prepare to migrate it to
Amazon Redshift. To manage the data extraction agents, you can use AWS SCT.
You can use AWS SCT to optimize your existing Amazon Redshift database. AWS SCT recommends sort keys and distribution keys to optimize your database.
Following, you can find more information about these processes.
Topics
•
Converting Data Warehouse Schema to Amazon Redshift by Using the AWS Schema Conversion
•
The AWS Schema Conversion Tool Extension Pack and Python Libraries for Data
•
Using Data Extraction Agents (p. 110)
•
Optimizing Amazon Redshift by Using the AWS Schema Conversion Tool (p. 119)
Version 1.0
86
AWS Schema Conversion Tool User Guide
Converting Data Warehouse Schema
Converting Data Warehouse Schema to Amazon
Redshift by Using the AWS Schema Conversion
Tool
The AWS Schema Conversion Tool (AWS SCT) automates much of the process of converting your data warehouse schema to a Amazon Redshift database schema. The source and target database engines contain many different features and capabilities, and AWS SCT attempts to create an equivalent schema in your target database wherever possible. If no direct conversion is possible, AWS SCT provides a list of possible actions for you to take.
AWS SCT supports the following data warehouse conversions.
Source Database
Greenplum Database (version 4.3 and later)
Microsoft SQL Server (version 2008 and later)
Netezza (version 7.2 and later)
Oracle (version 11 and later)
Teradata (version 14 and later)
Vertica (version 7.2.2 and later)
Target Database on Amazon Redshift
Amazon Redshift
Amazon Redshift
Amazon Redshift
Amazon Redshift
Amazon Redshift
Amazon Redshift
If you want to convert an online transaction processing (OLTP) database schema, see Converting
Database Schema to Amazon RDS by Using the AWS Schema Conversion Tool (p. 68)
.
Almost all work you do with AWS SCT starts with the following three steps:
1. Create an AWS SCT project.
2. Connect to your source database.
3. Connect to your target database.
If you have not created an AWS SCT project yet, see
Getting Started with the AWS Schema Conversion
To convert your data warehouse schema to Amazon RDS, you take the following high-level steps:
• Choose your optimization strategy – To optimize how AWS SCT converts your data warehouse schema, you can choose the strategies and rules you want the tool to use.
For more information, see
Choosing Optimization Strategies and Rules for Use with the AWS Schema
.
• Collect statistics – To optimize how AWS SCT converts your data warehouse schema, you can provide statistics from your source database that the tool can use. You can either collect statistics directly from the database, or upload an existing statistics file.
For more information, see
Collecting or Uploading Statistics for the AWS Schema Conversion
Version 1.0
87
AWS Schema Conversion Tool User Guide
Converting Data Warehouse Schema
• Create mapping rules – Before you convert your schema with AWS SCT, you can set up rules that change the data type of columns, move objects from one schema to another, and change the names of objects.
For more information, see
Creating Mapping Rules in the AWS Schema Conversion Tool (p. 91)
.
• Convert your schema – AWS SCT creates a local version of the converted schema for you to review, but it doesn't apply it to your target database until you are ready.
For more information, see
Converting Your Schema by Using the AWS Schema Conversion
• Manage and customize keys – After you convert your schema, you can manage and edit your keys. Key management is the heart of a data warehouse conversion.
For more information, see
Managing and Customizing Keys in the AWS Schema Conversion
• Create a database migration assessment report – AWS SCT creates a database migration assessment report that details the schema elements that can't be converted automatically. You can use this report to identify where you need to manually create a schema in your target database that is compatible with your source database.
For more information, see
Creating and Using the Assessment Report in the AWS Schema Conversion
• Decide how to handle manual conversions – If you have schema elements that can't be converted automatically, you have two choices: update the source schema and then convert again, or create equivalent schema elements in your target database.
For more information, see
Handling Manual Conversions in the AWS Schema Conversion
• Update and refresh the schema in your AWS SCT project – You can update your AWS SCT project with the most recent schema from your source database.
For more information, see
Updating and Refreshing Your Converted Schema in the AWS Schema
.
• Apply the converted schema to your target database – When you are ready, have AWS SCT apply the converted schema in your local project to your target database.
For more information, see
Saving and Applying Your Converted Schema in the AWS Schema
.
Version 1.0
88
AWS Schema Conversion Tool User Guide
Choosing Optimization Strategies and Rules
Choosing Optimization Strategies and Rules for Use with the AWS Schema Conversion Tool
To optimize how the AWS Schema Conversion Tool (AWS SCT) converts your data warehouse schema, you can choose the strategies and rules you want the tool to use. After converting your schema, and reviewing the suggested keys, you can adjust your rules or change your strategy to get the results you want.
To choose your optimization strategies and rules
1. Choose Settings, and then choose Project Settings. The Current project settings dialog box appears.
2. In the left pane, choose Optimization Strategies. The optimization strategies appear in the right pane with the defaults selected.
3. For Strategy Sector, choose the optimization strategy you want to use. You can choose from the following:
•
Use metadata, ignore statistical information – In this strategy, only information from the metadata is used for optimization decisions. For example, if there is more than one index on a source table, the source database sort order is used, and the first index becomes a distribution key.
• Ignore metadata, use statistical information – In this strategy, optimization decisions are derived from statistical information only. This strategy applies only to tables and columns for which statistics are provided. For more information, see
Collecting or Uploading Statistics for the AWS
Schema Conversion Tool (p. 90) .
• Use metadata and use statistical information – In this strategy, both metadata and statistics are used for optimization decisions.
4. After you choose your optimization strategy, you can choose the rules you want to use. You can choose from the following:
•
Choose Distribution Key and Sort Keys using metadata
•
Choose fact table and appropriate dimension for collation
•
Analyze cardinality of indexes' columns
•
Find the most used tables and columns from QueryLog table
For each rule, you can enter a weight for the sort key and a weight for the distribution key. AWS SCT uses the weights you choose when it converts your schema. Later, when you review the suggested keys, if you are not satisfied with the results, you can return here and change your settings. For more
information, see Managing and Customizing Keys in the AWS Schema Conversion Tool (p. 97) .
Related Topics
• Choose the Best Sort Key
• Choose the Best Distribution Style
Version 1.0
89
AWS Schema Conversion Tool User Guide
Collecting or Uploading Statistics
Collecting or Uploading Statistics for the AWS
Schema Conversion Tool
To optimize how the AWS Schema Conversion Tool (AWS SCT) converts your data warehouse schema, you can provide statistics from your source database that the tool can use. You can either collect statistics directly from the database, or upload an existing statistics file.
To provide and review statistics
1. Connect to your source database. For more information, see
.
2. Choose a schema object from the left panel of your project, and open the context (right-click) menu for the object. Choose Collect Statistics or Upload Statistics as shown following.
3. Choose a schema object from the left panel of your project, and then choose the Statistics tab. You can review the statistics for the object.
Version 1.0
90
AWS Schema Conversion Tool User Guide
Creating Mapping Rules
Later, when you review the suggested keys, if you are not satisfied with the results, you can collect additional statistics and repeat this procedure. For more information, see
Keys in the AWS Schema Conversion Tool (p. 97)
.
Related Topics
•
Choosing Optimization Strategies and Rules for Use with the AWS Schema Conversion Tool (p. 89)
• Choose the Best Sort Key
• Choose the Best Distribution Style
Creating Mapping Rules in the AWS Schema
Conversion Tool
Before you convert your schema with the AWS Schema Conversion Tool (AWS SCT), you can set up rules that change the data type of columns, move objects from one schema to another, and change the names
Version 1.0
91
AWS Schema Conversion Tool User Guide
Creating Mapping Rules of objects. For example, if you have a set of tables in your source schema named test_TABLE_NAME
, you can set up a rule that changes the prefix test_
to the prefix demo_
in the target schema.
Note
You can only create mapping rules if your source database engine and target database engine are different.
You can create mapping rules that perform the following tasks:
• Change data type
• Move objects
• Rename objects
• Prefix - add prefix, remove prefix, replace prefix
• Suffix - add suffix, remove suffix, replace suffix
You can create mapping rules for the following objects:
• Database
• Schema
• Table
• Column
Creating Mapping Rules
You can create mapping rules and save the rules as part of your project. With your project open, use the following procedure to create mapping rules.
To create mapping rules
1. Choose Mapping Rules from the Settings menu. The Mapping Rules dialog box appears.
2. Choose
Add new rule. A new row is added to the list of rules.
3. Choose the edit icon to configure your rule.
Version 1.0
92
AWS Schema Conversion Tool User Guide
Converting Your Schema a. For Name, type a name for your rule.
b. For For, choose the type of object that the rule applies to.
c.
For where, type a filter to apply to objects before applying the mapping rule. The where clause is evaluated by using a like clause. You can enter an exact name to select one object, or you can enter a pattern to select multiple objects.
The fields available for the where clause are different depending on the type of the object. For example, if the object type is schema there is only one field available, for the schema name.
d. For Actions, choose the type of mapping rule you want to create.
e. Depending on the rule type, type one or two additional values. For example, to rename an object, type the new name of the object. To replace a prefix, type the old prefix and the new prefix.
4. After you have configured your mapping rule, choose Save to save your rule. You can also choose
Cancel to cancel your changes.
5. After you are done adding, editing, and deleting rules, choose Save All to save all your changes.
6. Choose Close to close the Mapping Rules dialog box.
You can use the toggle icon to turn off a mapping rule without deleting it. You can use the copy icon to duplicate an existing mapping rule. You can use the delete icon to delete an existing mapping rule. To save any changes you make to your mapping rules, choose Save All.
Viewing Mapping Rules for Objects
After you set up your mapping rules, you can view the effect of the rules on specific objects in your schema before you convert your schema. In the source schema tree, choose the object you are interested in. In the main view, choose the Mapping tab. The Mapping tab opens and displays a list of all mapping rules that are applied to the object. You can see the name of the object in the source schema and the new name of the object in the target schema. If you have data type rules, you also see the data type of the column in the source schema and the new data type of the column in the target schema.
Exporting Mapping Rules
If you use AWS Database Migration Service (AWS DMS) to migrate your data from your source database to your target database, you can provide information about your mapping rules to AWS DMS. For more information about tasks, see Working with AWS Database Migration Service Replication Tasks .
To export mapping rules
1. In the AWS Schema Conversion Tool, in the source schema tree, open the context (right-click) menu and choose Export script for DMS. The save dialog box opens.
2. Browse to the location where you want to save your script, and then choose Save. Your mapping rules are saved as a JSON script that can be consumed by AWS DMS.
Converting Your Schema by Using the AWS Schema
Conversion Tool
After you have connected your project to both your source database and your target database, your AWS
Schema Conversion Tool (AWS SCT) project displays the schema from your source database in the left panel. The schema is presented in a tree-view format, and each node of the tree is lazy loaded. When you choose a node in the tree view, AWS SCT requests the schema information from your source database at that time.
Version 1.0
93
AWS Schema Conversion Tool User Guide
Converting Your Schema
You can choose schema items from your source database and then convert the schema to equivalent schema for the database engine of your target database. You can choose any schema item from your source database to convert. If the schema item that you choose depends on a parent item, then AWS
SCT also generates the schema for the parent item. For example, if you choose a column from a table to convert, then AWS SCT generates the schema for the column, the table that the column is in, and the database that the table is in.
Converting Schema
To convert schema from your source database, choose a schema object to convert from the left panel of your project. Open the context (right-click) menu for the object, and then choose Convert schema, as shown following.
After you have converted the schema from your source database, you can choose schema items from the left panel of your project and view the converted schema in the center panels of your project. The lowercenter panel displays the properties of and the SQL command to create the converted schema, as shown following.
Version 1.0
94
AWS Schema Conversion Tool User Guide
Converting Your Schema
After you have converted your schema, you can save your project. The schema information from your source database is saved with your project. This functionality means that you can work offline without being connected to your source database. AWS SCT connects to your source database to update the schema in your project if you choose
Refresh from Database for your source database. For more information, see
Updating and Refreshing Your Converted Schema in the AWS Schema Conversion
You can create a database migration assessment report of the items that can't be converted automatically. The assessment report is useful for identifying and resolving schema items that can't be converted automatically. For more information, see
Creating and Using the Assessment Report in the
AWS Schema Conversion Tool (p. 98) .
When AWS SCT generates a converted schema, it doesn't immediately apply it to the target database.
Instead, the converted schema is stored locally until you are ready to apply it to the target database. For more information, see
Applying Your Converted Schema (p. 105) .
Editing Converted Schema
You can edit converted schema and save the changes as part of your project.
To edit converted schema
1. In the left panel that displays the schema from your source database, choose the schema item that you want to edit the converted schema for.
Version 1.0
95
AWS Schema Conversion Tool User Guide
Converting Your Schema
2. In the lower-center panel that displays the converted schema for the selected item, choose the
SQL
tab.
3. In the text displayed for the SQL tab, change the schema as needed. The schema is automatically saved with your project as you update it.
The changes that you make to converted schema are stored with your project as you make updates. If you newly convert a schema item from your source database, and you have made updates to previously converted schema for that item, those existing updates are replaced by the newly converted schema item based on your source database.
Clearing a Converted Schema
Until you apply the schema to your target database, AWS SCT only stores the converted schema locally in your project. You can clear the planned schema from your project by choosing the tree-view node for your target database, and then choosing Refresh from Database. Because no schema has been written to your target database, refreshing from the database removes the planned schema elements in your
AWS SCT project to match what exists in your target database.
Version 1.0
96
AWS Schema Conversion Tool User Guide
Managing and Customizing Keys
Managing and Customizing Keys in the AWS Schema
Conversion Tool
After you convert your schema with the AWS Schema Conversion Tool (AWS SCT), you can manage and edit your keys. Key management is the heart of a data warehouse conversion.
To manage keys, select a table in your target database, and then choose the Key Management tab as shown following.
Version 1.0
97
AWS Schema Conversion Tool User Guide
Creating and Using the Assessment Report
The left pane contains key suggestions, and includes the confidence rating for each suggestion. You can choose one of the suggestions, or you can customize the key by editing it in the right pane.
If the choices for the key don't look like what you expected, you can edit your edit your optimization strategies, and then retry the conversion. For more information, see
Choosing Optimization Strategies and Rules for Use with the AWS Schema Conversion Tool (p. 89)
.
Related Topics
• Choose the Best Sort Key
• Choose the Best Distribution Style
Creating and Using the Assessment Report in the
AWS Schema Conversion Tool
The AWS Schema Conversion Tool (AWS SCT) creates a database migration assessment report to help you convert your schema. The database migration assessment report provides important information about the conversion of the schema from your source database to your target database. The report summarizes all of the schema conversion tasks and details the action items for schema that can't be converted to the
DB engine of your target database. The report also includes estimates of the amount of effort that it will take to write the equivalent code in your target database that can't be converted automatically.
Creating a Database Migration Assessment Report
Use the following procedure to create a database migration assessment report.
Version 1.0
98
AWS Schema Conversion Tool User Guide
Creating and Using the Assessment Report
To create a database migration assessment report
1. In the left panel that displays the schema from your source database, choose a schema object to create an assessment report for.
2. Open the context (right-click) menu for the object, and then choose Create Report.
Assessment Report Summary
After you create an assessment report, the assessment report view opens, showing the Summary tab.
The Summary tab displays the summary information from the database migration assessment report. It shows items that were converted automatically, and items that were not converted automatically.
Version 1.0
99
AWS Schema Conversion Tool User Guide
Creating and Using the Assessment Report
For schema items that can't be converted automatically to the target database engine, the summary includes an estimate of the effort that it will take to create schema items in your target database that are equivalent to those in your source database.
The report categorizes the estimated time to convert these schema items as follows:
• Simple – Actions that can be completed in less than 1 hour.
• Medium – Actions that are more complex and can be completed in 1 to 4 hours.
• Significant – Actions that are very complex and take more than 4 hours to complete.
Assessment Report Action Items
The assessment report view also includes an Action Items tab. This tab contains a list of items that can't be converted automatically to the database engine of your target database. If you select an action item from the list, AWS SCT highlights the item from your schema that the action item applies to.
The report also contains recommendations for how to manually convert the schema item. For more
information about deciding how to handle manual conversions, see Handling Manual Conversions in the
AWS Schema Conversion Tool (p. 102)
.
Version 1.0
100
AWS Schema Conversion Tool User Guide
Creating and Using the Assessment Report
Saving the Assessment Report
You can save a local copy of the database migration assessment report as either a PDF file or a commaseparated values (CSV) file. The CSV file contains only action item information. The PDF file contains both the summary and action item information, as shown in the following example.
Version 1.0
101
AWS Schema Conversion Tool User Guide
Handling Manual Conversions
Handling Manual Conversions in the AWS Schema
Conversion Tool
The assessment report includes a list of items that can't be converted automatically to the database engine of your target database. For each item that can't be converted, there is an action item on the
Action Items tab.
You can respond to the action items in the assessment report in the following ways:
• Modify your source database schema.
• Modify your target database schema.
Version 1.0
102
AWS Schema Conversion Tool User Guide
Updating and Refreshing Your Converted Schema
Modifying Your Source Schema
For some items, it might be easier to modify the database schema in your source database to schema that can be converted automatically. First, verify that the new changes are compatible with your application architecture, then update the schema in your source database. Finally, refresh your project with the updated schema information. You can then convert your updated schema, and generate a new database migration assessment report. The action items no longer appear for the items that changed in the source schema.
The advantage of this process is that your updated schema is always available when you refresh from your source database.
Modifying Your Target Schema
For some items, it might be easier to apply the converted schema to your target database, and then add equivalent schema items manually to your target database for the items that couldn't be converted automatically. You can write all of the schema that can be converted automatically to your target
database by applying the schema. For more information, see Saving and Applying Your Converted
Schema in the AWS Schema Conversion Tool (p. 104)
.
The schema that are written to your target database don't contain the items that can't be converted automatically. After applying the schema to your target database, you can then manually create schema in your target database that are equivalent to those in the source database. The action items in the database migration assessment report contain suggestions for how to create the equivalent schema.
Warning
If you manually create schema in your target database, save a copy of any manual work that you do. If you apply the converted schema from your project to your target database again, it overwrites the manual work you have done.
In some cases, you can't create equivalent schema in your target database. You might need to rearchitect a portion of your application and database to use the functionality that is available from the engine for your target database. In other cases, you can simply ignore the schema that can't be converted automatically.
Related Topics
•
Converting Your Schema by Using the AWS Schema Conversion Tool (p. 93)
•
Creating and Using the Assessment Report in the AWS Schema Conversion Tool (p. 98)
•
Updating and Refreshing Your Converted Schema in the AWS Schema Conversion Tool (p. 103)
Updating and Refreshing Your Converted Schema in the AWS Schema Conversion Tool
You can update both the source schema and the target schema in your AWS Schema Conversion Tool
(AWS SCT) project.
• Source – If you update the schema for your source database, AWS SCT replaces the schema in your project with the latest schema from your source database. Using this functionality, you can update your project if changes have been made to the schema of your source database.
• Target – If you update the schema for your target database, AWS SCT replaces the schema in your project with the latest schema from your target database. If you haven't applied any schema to your
Version 1.0
103
AWS Schema Conversion Tool User Guide
Saving and Applying Your Schema
target database, AWS SCT clears the converted schema from your project. You can then convert the schema from your source database for a clean target database.
You update the schema in your AWS SCT project by choosing Refresh from Database, as shown following.
Saving and Applying Your Converted Schema in the
AWS Schema Conversion Tool
When the AWS Schema Conversion Tool (AWS SCT) generates converted schema (as shown in
Your Schema by Using the AWS Schema Conversion Tool (p. 93) ), it doesn't immediately apply
the converted schema to the target database. Instead, converted schema are stored locally in your project until you are ready to apply them to the target database. Using this functionality, you can work with schema items that can't be converted automatically to your target database engine. For more
information on items that can't be converted automatically, see Creating and Using the Assessment
Report in the AWS Schema Conversion Tool (p. 98) .
You can optionally have the tool save your converted schema to a file as a SQL script prior to applying the schema to your target database. You can also have the tool apply the converted schema directly to your target database.
Saving Your Converted Schema to a File
You can save your converted schema as SQL scripts in a text file. By using this approach, you can modify the generated SQL scripts from AWS SCT to address items that the tool can't convert automatically.
Version 1.0
104
AWS Schema Conversion Tool User Guide
Saving and Applying Your Schema
You can then run your updated scripts on your target database to apply your converted schema to your target database.
To save your converted schema as SQL scripts, open the context (right-click) menu for the schema element, and choose Save as SQL, as shown following.
Applying Your Converted Schema
When you are ready to apply your converted schema to your target database, choose the schema element from the right panel of your project. Open the context (right-click) menu for the schema element, and then choose Apply to database, as shown following.
Version 1.0
105
AWS Schema Conversion Tool User Guide
Saving and Applying Your Schema
The Extension Pack Schema
The first time that you apply your converted schema to your target DB instance, AWS SCT adds an additional schema to your target DB instance. This schema implements system functions of the source database that are required when writing your converted schema to your target DB instance. The schema is called the extension pack schema.
Don't modify the extension pack schema, or you might encounter unexpected results in the converted schema that is written to your target DB instance. When your schema is fully migrated to your target DB instance, and you no longer need AWS SCT, you can delete the extension pack schema.
The extension pack schema is named according to your source database as follows:
• Greenplum:
AWS_GREENPLUM_EXT
• Microsoft SQL Server:
AWS_SQLSERVER_EXT
• Netezza:
AWS_NETEZZA_EXT
• Oracle:
AWS_ORACLE_EXT
• Teradata:
AWS_TERADATA_EXT
• Vertica:
AWS_VERTICA_EXT
For more information, see
The AWS Schema Conversion Tool Extension Pack and Python Libraries for
Version 1.0
106
AWS Schema Conversion Tool User Guide
Saving and Applying Your Schema
Python Libraries
To create custom functions in Amazon Redshift, you use the Python language. Use the AWS SCT extension pack to install python libraries for your Amazon Redshift database. For more information, see
The AWS Schema Conversion Tool Extension Pack and Python Libraries for Data Warehouses (p. 108) .
Version 1.0
107
AWS Schema Conversion Tool User Guide
The Extension Pack and Python
Libraries for Data Warehouses
The AWS Schema Conversion Tool Extension Pack and Python Libraries for Data Warehouses
When you convert your data warehouse schema, the AWS Schema Conversion Tool (AWS SCT) adds an additional schema to your target DB instance. This schema implements system functions of the source database that are required when writing your converted schema to your target DB instance. The schema is called the extension pack schema.
The extension pack schema is named according to your source database as follows:
• Greenplum:
AWS_GREENPLUM_EXT
• Microsoft SQL Server:
AWS_SQLSERVER_EXT
• Netezza:
AWS_NETEZZA_EXT
• Oracle:
AWS_ORACLE_EXT
• Teradata:
AWS_TERADATA_EXT
• Vertica:
AWS_VERTICA_EXT
In two cases, you might want to install the extension pack manually:
• You accidentally delete the extension pack database schema from your target database.
• You want to upload custom Python libraries to emulate database functionality.
Using AWS Services to Upload Custom Python
Libraries
In some cases, source database features can't be converted to equivalent Amazon Redshift features. AWS
SCT contains a custom Python library that emulates some source database functionality on Amazon
Redshift.
The AWS SCT extension pack wizard helps you install the custom Python library.
Before You Begin
Almost all work you do with AWS SCT starts with the following three steps:
1. Create an AWS SCT project.
2. Connect to your source database.
3. Connect to your target database.
If you have not created an AWS SCT project yet, see
Getting Started with the AWS Schema Conversion
Before you install the extension pack, you need to convert your database schema. For more information,
see Converting Data Warehouse Schema to Amazon Redshift by Using the AWS Schema Conversion
Applying the Extension Pack
Use the following procedure to apply the extension pack.
Version 1.0
108
AWS Schema Conversion Tool User Guide
Related Topics
To apply the extension pack
1. In the AWS Schema Conversion Tool, in the target database tree, open the context (right-click) menu, and choose
Apply Extension Pack.
The extension pack wizard appears.
2. Read the Welcome page, and then choose Next.
3. On the AWS Services Settings page, do the following:
• If you are reinstalling the extension pack database schema only, choose Skip this step for now, and then choose
Next.
• If you are uploading the Python library, provide the credentials to connect to your AWS account.
You can use your AWS Command Line Interface (AWS CLI) credentials if you have the AWS
CLI installed. You can also use credentials that you previously stored in a profile in the global application settings and associated with the project. If necessary, choose
Navigate to Project
Settings to associate a different profile with the project. If necessary, choose Global Settings to create a new profile. For more information, see
Storing AWS Profiles in the AWS Schema
.
4. On the Python Library Upload page, do the following:
• If you are reinstalling the extension pack database schema only, choose Skip this step for now, and then choose Next.
• If you are uploading the Python library, provide the Amazon S3 path, and then choose
Upload
Library to S3. When you are done, choose Next.
5. On the Functions Emulation page, choose Create Extension Pack. Messages appear with the status of the extension pack operations. When you are done, choose Finish.
Related Topics
• Python Language Support for UDFs
Version 1.0
109
AWS Schema Conversion Tool User Guide
Using Data Extraction Agents
Using Data Extraction Agents
You can use data extraction agents to extract data from your on-premises data warehouse and migrate it to Amazon Redshift. To manage the data extraction agents, you can use AWS SCT. Data extraction agents can work in the background while AWS SCT is closed. After your agents extract your data, they upload the data to Amazon S3 and then copy the data into Amazon Redshift.
The following diagram shows the supported scenario.
Data extraction agents are currently supported for the following source data warehouses:
• Greenplum Database (version 4.3 and later)
• Microsoft SQL Server (version 2008 and later)
• Netezza (version 7.2 and later)
• Oracle (version 11 and later)
• Teradata (version 14 and later)
• Vertica (version 7.2.2 and later)
Amazon S3 Settings
After your agents extract your data, they upload it to your Amazon S3 bucket. Before you continue, you must provide the credentials to connect to your AWS account and your Amazon S3 bucket. You store your credentials and bucket information in a profile in the global application settings, and then associate the profile with your AWS SCT project. If necessary, choose Global Settings to create a new profile. For more information, see
Storing AWS Profiles in the AWS Schema Conversion Tool (p. 131)
.
Security Settings
The AWS Schema Conversion Tool and the extraction agents can communicate through Secure Sockets
Layer (SSL). To enable SSL, set up a trust store and key store.
Version 1.0
110
AWS Schema Conversion Tool User Guide
Installing Agents
To set up secure communication with your extraction agent
1. Start the AWS Schema Conversion Tool.
2. Open the Settings menu, and then choose Global Settings. The Global settings dialog box appears.
Choose the Security tab as shown following.
3. Choose Generate Trust and Key Store, or choose Select existing Trust and Key Store.
If you choose Generate Trust and Key Store, you then specify the name and password for the trust and key stores, and the path to the location for the generated file. A .zip file is generated that contains the trust and key store files. You will use these files in later steps.
If you choose Select existing Trust and Key Store, you then specify the password and file name for the trust and key stores. You use these files in later steps.
4. After you have specified the trust store and key store, choose OK to close the Global Settings dialog box.
Installing Extraction Agents
We recommend that you install multiple extraction agents on individual computers, separate from the computer that is running the AWS Schema Conversion Tool.
Extraction agents are currently supported on the following operating systems:
Version 1.0
111
AWS Schema Conversion Tool User Guide
Installing Agents
• macOS
• Microsoft Windows
• Red Hat Enterprise Linux (RHEL) 6.0
• Ubuntu Linux (version 14.04 and later)
Use the following procedure to install extraction agents. Repeat this procedure for each computer that you want to install an extraction agent on.
To install an extraction agent
AWS SCT installer file also contains the extraction agent installer file.
2. Locate the installer file for your extraction agent in a subfolder named agents. The correct file for the operating system of the computer that you want to install the extraction agent on is shown following.
Operating System
macOS
Microsoft Windows
File Name
aws-schema-conversion-tool-extractor-1.0.
build-number
.dmg
aws-schema-conversion-tool-extractor-1.0.
build-number
.msi
RHEL aws-schema-conversion-tool-extractor-1.0.
buildnumber
.x86_64.rpm
Ubuntu Linux aws-schema-conversion-tool-extractor-1.0.
build-number
.deb
3. To install the extraction agent on a separate computer, copy the installer file to the new computer.
4. Run the installer file. Use the instructions for your operating system, shown following.
Operating System
macOS
Microsoft Windows
RHEL
Install Instructions
In Finder, open aws-schema-conversion-tool-extractor-1.0.
buildnumber
.dmg
.
Drag aws-schema-conversion-tool-extractor-1.0.
build-number
.dmg
to the Applications folder.
Double-click the file to run the installer.
Run the following command in the folder that you downloaded or moved the file to:
Ubuntu Linux sudo rpm -ivh aws-schema-conversion-tool-extractor-1.0.
buildnumber
.x86_64.rpm
Run the following command in the folder that you downloaded or moved the file to: sudo dpkg -i aws-schema-conversion-tool-extractor-1.0.
buildnumber
.deb
5. Install the Java Database Connectivity (JDBC) drivers for your source database engine. For
instructions and download links, see Installing the Required Database Drivers (p. 7)
. Follow the instructions for your source database engine only, not your target database engine.
Version 1.0
112
AWS Schema Conversion Tool User Guide
Configuring Agents
6. Copy the SSL trust and key stores (.zip or individual files) that you generated in an earlier procedure.
If you copy the .zip file to a new computer, extract the individual files from the .zip file on the new computer.
You can put the files anywhere you want, but note the locations because in a future procedure you tell the agent where to find the files.
Continue installing your extraction agent by completing the procedure in the following section.
Configuring Extraction Agents
Use the following procedure to configure extraction agents. Repeat this procedure on each computer that has an extraction agent installed.
To configure your extraction agent
• From the location where you installed the agent, run the setup program. For RHEL and Ubuntu, the file is named sct-extractor-setup.sh
. For macOS and Microsoft Windows, the file is named
AWS
SCT Data Extractor Agent
, and you can double-click the file to run it.
The setup program prompts you for information. For each prompt, a default value appears. You can accept the default value, or type a new value. You specify the following information:
• The data warehouse engine.
• The port number the agent listens on.
• The location where you installed the JDBC drivers.
• The working folder. Your extracted data goes into a subfolder of this location. The working folder can be on a different computer from the agent, and a single working folder can be shared by multiple agents on different computers.
• The location of the key store file.
• The password for the key store.
• The location of the trust store file.
• The password for the trust store.
The setup program updates the settings file for the extraction agent. The settings file is named
Settings.properties
, and is located where you installed the extraction agent. The following is a sample settings file.
port=8888 vendor=ORACLE driver.jars=
<driver path>
/Install/Drivers/
ojdbc7.jar
location=
<output path>
/dmt/8888/out extractor.log.folder=
<log path>
/dmt/8888/log extractor.storage.folder=
<storage path>
/dmt/8888/storage extractor.start.fetch.size=20000 extractor.out.file.size=10485760 ssl.option=OFF
#ssl.option=ON
#ssl.keystore.path=
<key store path>
/dmt/8888/vault/keystore
#ssl.truststore.path=
<trust store path>
/dmt/8888/vault/truststore
Starting Extraction Agents
Use the following procedure to start extraction agents. Repeat this procedure on each computer that has an extraction agent installed.
Version 1.0
113
AWS Schema Conversion Tool User Guide
Registering Agents
Extraction agents act as listeners. When you start an agent with this procedure, the agent starts listening for instructions. You send the agents instructions to extract data from your data warehouse in a later section.
To start your extraction agent
• On the computer that has the extraction agent installed, run the command listed following for your operating system.
Operating System
macOS
Microsoft Windows
RHEL
Ubuntu Linux
Start Command
Run the
StartAgent.command
file.
Double-click the
StartAgent.bat
batch file.
Run the following command in the path to the folder that you installed the agent: sudo initctl
start
sct-extractor
Run the following command in the path to the folder that you installed the agent. Use the command appropriate for your version of Ubuntu.
Ubuntu 14.04: sudo initctl
start
sct-extractor
Ubuntu 15.04 and later: sudo systemctl
start
sct-extractor
To check the status of the agent, run the same command but replace start
with status
.
To stop an agent, run the same command but replace start
with stop
.
Registering Extraction Agents
You manage your extraction agents by using AWS SCT. The extraction agents act as listeners. When they receive instructions from AWS SCT, they extract data from your data warehouse.
Use the following procedure to register extraction agents with your AWS SCT project.
To register an extraction agent
1. Start the AWS Schema Conversion Tool, and open a project.
a. Open an existing or create a new project. For more information, see Creating an AWS Schema
Conversion Tool Project (p. 12)
.
b. Connect to your source database. For more information, see Connecting to Your Source
c.
Connect to your target database. For more information, see Connecting to Your Target
d. Convert your schema. For more information, see
Converting Data Warehouse Schema to
Amazon Redshift by Using the AWS Schema Conversion Tool (p. 87)
.
e. Apply your schema. For more information, see
Saving and Applying Your Converted Schema in the AWS Schema Conversion Tool (p. 104) .
2. Open the View menu, and then choose Data Migration View. The Agents tab appears. If you have previously registered agents, they appear in a grid at the top of the tab as shown following.
Version 1.0
114
AWS Schema Conversion Tool User Guide
Extraction Tasks
3. Choose Register. The New Agent Registration dialog box appears.
Note
After you register an agent with an AWS SCT project, you can't register the same agent with a different project. If you're no longer using an agent in an AWS SCT project, you can unregister it, and then register it with a different project.
4. Enter your information in the New Agent Registration dialog box: a. For Description, type a description of the agent.
b. For Host Name, type the host name or IP address of the computer of the agent.
c.
For Port, type the port number that the agent is listening on.
d. Choose
Register to register the agent with your AWS SCT project.
5. Repeat the previous steps to register multiple agents with your AWS SCT project.
Managing Extraction Tasks
Use the following procedures to create, run, and monitor data extraction tasks.
To assign tasks to agents and migrate data
1. In the AWS Schema Conversion Tool, after you have converted your schema, choose one or more tables from the left panel of your project. You can choose all tables, but we recommend against that for performance reasons. We recommend that you create multiple tasks for multiple tables based on the size of the tables in your data warehouse.
2. Open the context (right-click) menu for the tables, and then choose Create Task. The Create Local
Task dialog box opens.
a. For Task Name, type a name for the task.
b. For Migration Mode, choose one of the following:
Version 1.0
115
AWS Schema Conversion Tool User Guide
Extraction Output
• Extract Only – extract your data, and save the date to your local working folders.
• Extract and Upload – extract your data, and upload your data to Amazon S3.
• Extract, Upload and Copy – extract your data, upload your data to Amazon S3, and copy it into your Amazon Redshift data warehouse.
c.
Choose Test Task to verify that you can connect to your working folder, Amazon S3 bucket, and
Amazon Redshift data warehouse. The verification depends on the migration mode you chose.
d. Choose Create to create the task.
3. Repeat the previous steps to create tasks for all the data that you want to migrate.
To run and monitor tasks
1. Open the View menu, and then choose Data Migration View. The Agents tab appears.
2. Choose the Tasks tab. Your tasks appear in the grid at the top as shown following.
3. Select a task in the top grid and expand it. Depending on the migration mode you chose, you see the task divided into Extract, Upload, and Copy.
4. Select a task in the top grid. You can see the status of the task in the top grid, and the status of its subtasks in the bottom grid.
5. To run a task, choose Start. You can monitor the status of your tasks while they work. The subtasks run in parallel. The extract, upload, and copy also run in parallel.
You can close AWS SCT and your agents and tasks continue to run. You can then reopen AWS SCT and check the status of your tasks.
Extraction Task Output
After your migration tasks complete, your data is ready. Use the following information to determine how to proceed based on the migration mode you chose and the location of your data.
Version 1.0
116
AWS Schema Conversion Tool User Guide
Extraction Output
Migration
Mode
Extract,
Upload and
Copy
Extract and
Upload
Data Location
The data is already in your Amazon Redshift data warehouse. You can verify that the data is there, and start using it. For more information, see Connecting to Clusters
From Client Tools and Code .
The extraction agents saved your data as files in your Amazon S3 bucket. You can use the Amazon Redshift COPY command to load your data to Amazon Redshift.
For more information, see Loading Data from Amazon S3 in the Amazon Redshift documentation.
There are multiple folders in your Amazon S3 bucket, corresponding to the extraction tasks that you set up. When you load your data to Amazon Redshift, specify the name of the manifest file created by each task. The manifest file appears in the task folder in your S3 bucket as shown following.
Extract Only
The extraction agents saved your data as files in your working folder. Manually copy your data to your Amazon S3 bucket, and then proceed with the instructions for
Extract and Upload.
Version 1.0
117
AWS Schema Conversion Tool User Guide
Best Practices and Troubleshooting
Best Practices and Troubleshooting
The following are some best practices and troubleshooting suggestions for using extraction agents.
Issue
Performance is slow
Contention delays
Troubleshooting Suggestions
To improve performance, we recommend the following:
• Install multiple agents.
• Install agents on computers close to your data warehouse.
• Don't run all tables on a single agent task.
Avoid having too many agents accessing your data warehouse at the same time.
An agent goes down temporarily If an agent is down, the status of each of its tasks appears as failed in AWS SCT. If you wait, in some cases the agent can recover. In this case, the status of its tasks updates in AWS SCT.
An agent goes down permanently
If the computer running an agent goes down permanently, and that agent is running a task, you can substitute a new agent to continue the task. You can substitute a new agent only if the working folder of the original agent was not on the same computer as the original agent. To substitute a new agent, do the following:
• Install an agent on a new computer.
• Configure the new agent with the same settings, including port number and working folder, as the original agent.
• Start the agent. After the agent starts, the task discovers the new available agent and continues running on the new agent.
Version 1.0
118
AWS Schema Conversion Tool User Guide
Optimizing Amazon Redshift
Optimizing Amazon Redshift by Using the AWS
Schema Conversion Tool
You can use the AWS Schema Conversion Tool (AWS SCT) to optimize your Amazon Redshift database.
Using your Amazon Redshift database as a source, and a test Amazon Redshift database as the target,
AWS SCT recommends sort keys and distribution keys to optimize your database.
Before You Begin
Almost all work you do with AWS SCT starts with the same three steps. Complete the following steps before you optimize your Amazon Redshift database:
1. Create an AWS SCT project. For more information, see Creating an AWS Schema Conversion Tool
.
2. Connect to your source database. For more information, see
Connecting to an Amazon Redshift
.
3. Connect to your target database. For more information, see
.
Important
Don't use the same cluster for both the source and target of your optimization.
Before you optimize your Amazon Redshift database, you should also choose your optimization strategies. For more information, see
Choosing Optimization Strategies and Rules for Use with the AWS
Schema Conversion Tool (p. 89)
.
Optimizing Your Amazon Redshift Database
Use the following procedure to optimize your Amazon Redshift database.
To optimize your Amazon Redshift database
1. Take a manual snapshot of your Amazon Redshift cluster as a backup. You can delete the snapshot after you are done optimizing your Amazon Redshift cluster and testing any changes that you make.
For more information, see Amazon Redshift Snapshots .
2. Choose a schema object to convert from the left panel of your project. Open the context (right-click) menu for the object, and then choose Collect Statistics.
AWS SCT uses the statistics to make suggestions for sort keys and distribution keys.
3. Choose a schema object to optimize from the left panel of your project. Open the context (rightclick) menu for the object, and then choose Run Optimization.
AWS SCT makes suggestions for sort keys and distribution keys.
4. To review the suggestions, expand the tables node under your schema in the left panel of your project, and then choose a table. Choose the Key Management tab as shown following.
Version 1.0
119
AWS Schema Conversion Tool User Guide
Related Topics
The left pane contains key suggestions, and includes the confidence rating for each suggestion. You can choose one of the suggestions, or you can customize the key by editing it in the right pane.
5. You can create a report that contains the optimization suggestions. To create the report, do the following: a. Choose a schema object that you optimized from the left panel of your project. Open the context (right-click) menu for the object, and then choose Create Report.
The report opens in the main window, and the Summary tab appears. The number of objects with optimization suggestions appears in the report.
b. Choose the Action Items tab to see the key suggestions in a report format.
c.
You can save a local copy of the optimization report as either a PDF file or a comma-separated values (CSV) file. The CSV file contains only action item information. The PDF file contains both the summary and action item information.
6. To apply suggested optimizations to your database, choose an object in the right panel of your project. Open the context (right-click) menu for the object, and then choose Apply to database.
Related Topics
• Choose the Best Sort Key
• Choose the Best Distribution Style
•
Converting Data Warehouse Schema to Amazon Redshift by Using the AWS Schema Conversion
•
Installing and Updating the AWS Schema Conversion Tool (p. 6)
Version 1.0
120
AWS Schema Conversion Tool User Guide
Before You Begin
Working with the AWS Database
Migration Service Using the AWS
Schema Conversion Tool
AWS Database Migration Service (AWS DMS) is a web service that you can use to migrate data to and from most widely used commercial and open-source databases. You can use the AWS Schema Conversion
Tool (AWS SCT) to create AWS DMS endpoints and tasks. You can run and monitor the tasks from AWS
SCT. For more information about AWS DMS, see What Is AWS Database Migration Service?
in the AWS
DMS User Guide..
Before You Begin
Almost all work you do with AWS SCT starts with the following three steps:
1. Create an AWS SCT project.
2. Connect to your source database.
3. Connect to your target database.
If you have not created an AWS SCT project yet, see
Getting Started with the AWS Schema Conversion
Because AWS DMS interacts with the target schema, you need to convert your database schema before
you can integrate with AWS DMS. To convert your database schema, see Converting Database Schema to
Amazon RDS by Using the AWS Schema Conversion Tool (p. 68) .
Credentials for Working with AWS DMS
To create AWS DMS tasks, AWS SCT must connect to AWS DMS with your credentials. You can use credentials that you previously stored in a profile in the global application settings and associated
Version 1.0
121
AWS Schema Conversion Tool User Guide
Creating a Task with the project. For more information, see
Storing AWS Profiles in the AWS Schema Conversion
Creating an AWS DMS Task
After you use AWS SCT to convert your database schema, you can create AWS DMS tasks. Use the following procedure to create an AWS DMS task.
To create an AWS DMS task
1. In the AWS Schema Conversion Tool, choose a database or a schema object from the left panel of your project. Open the context (right-click) menu for the object, and then choose Create DMS Task.
The Create DMS task dialog box appears.
2. For Task name, type a name for your task.
3. For Replication instance, choose the replication instance that you want to use. For more information, see Replication Instances for AWS Database Migration Service .
4. For Source endpoint, choose an existing endpoint. You can also choose Create new to create a new endpoint. When you choose Create new, a new endpoint is created for you by using the current connection information. You can verify the connection information and give the endpoint a name before it is created.
5. For Target endpoint, choose an existing endpoint. You can also choose Create new to create a new endpoint. When you choose Create new, a new endpoint is created for you by using the current connection information. You can verify the connection information and give the endpoint a name before it is created.
6. For Include LOB columns in replication, choose Don’t include LOB columns, Full LOB mode, or
Limited LOB mode. For more information, see LOB Support for Source Databases .
7. For LOB chunk size (kb), type the LOB chunk size in kilobytes.
8. Select Enable logging to turn on logging for the task.
9. Choose Preview JSON to see the JSON that is created for the task.
10. Choose Save JSON to save a copy of the JSON that is created for the task.
11. After you have configured your task, choose Create to save your task. You can also choose Close to cancel your changes.
Running and Monitoring an AWS DMS Task
After you create AWS DMS tasks, you can run and monitor them in the data migration view. Use the following procedure to run and monitor your AWS DMS tasks.
To run and monitor your AWS DMS tasks
1. Open the View menu, and then choose Data Migration View.
2. In the list of tasks, choose the task you want to run. Choose Start to run the task. The Status column shows the status of the task.
3. When you have a running task, you can choose the following actions:
• Choose Stop to stop a task.
• Choose Resume to resume a task.
4. Choose Delete to delete a task.
5. Choose Refresh to refresh the task list. The Status column shows the current status of all tasks.
Version 1.0
122
AWS Schema Conversion Tool User Guide
Related Topics
6. Choose Show Log to see the task log. If you selected Enable logging when you created the task, the task log shows log information.
Related Topics
•
What Is the AWS Schema Conversion Tool? (p. 1)
• Working with AWS Database Migration Service Replication Tasks
• Monitoring AWS Database Migration Service Tasks
Version 1.0
123
AWS Schema Conversion Tool User Guide
Before You Begin
Converting Application SQL by Using the AWS Schema Conversion Tool
When you convert your database schema from one engine to another, you also need to update the SQL code in your applications to interact with the new database engine instead of the old one. You can use the AWS Schema Conversion Tool (AWS SCT) to convert the SQL code in your C++, C#, Java, or other application code. You can view, analyze, edit, and save the converted SQL code.
Before You Begin
Almost all work you do with AWS SCT starts with the following three steps:
1. Create an AWS SCT project.
2. Connect to your source database.
3. Connect to your target database.
If you have not created an AWS SCT project yet, see
Getting Started with the AWS Schema Conversion
Because the SQL code in your application interacts with your database schema, you need to convert your database schema before you can convert your application SQL. To convert your database schema, use the procedures in one of the following topics:
•
Converting Database Schema to Amazon RDS by Using the AWS Schema Conversion Tool (p. 68)
•
Converting Data Warehouse Schema to Amazon Redshift by Using the AWS Schema Conversion
Overview of Converting Application SQL
To convert the SQL code in your application, you take the following high-level steps:
Version 1.0
124
AWS Schema Conversion Tool User Guide
Creating Application Conversion Projects
• Create an application conversion project – The application conversion project is a child of the database schema conversion project. Each database schema conversion project can have one or more child application conversion projects.
For more information, see
Creating Application Conversion Projects in the AWS Schema Conversion
•
Analyze and convert your SQL code – AWS SCT analyzes your application, extracts the SQL code, and creates a local version of the converted SQL for you to review and edit. The tool doesn't change the code in your application until you are ready.
For more information, see
Analyzing and Converting Your SQL Code by Using the AWS Schema
.
• Create an application assessment report – The application assessment report provides important information about the conversion of the application SQL code from your source database schema to your target database schema.
For more information, see
Creating and Using the Assessment Report (p. 129)
.
• Edit, apply changes to, and save your converted SQL code – The assessment report includes a list of SQL code items that can't be converted automatically. For these items, you can edit the SQL code manually to perform the conversion.
For more information, see
Editing and Saving Your Converted SQL Code with the AWS Schema
.
Creating Application Conversion Projects in the
AWS Schema Conversion Tool
In the AWS Schema Conversion Tool (AWS SCT), the application conversion project is a child of the database schema conversion project. Each database schema conversion project can have one or more child application conversion projects. Use the following procedure to create an application conversion project.
To create an application conversion project
1. In the AWS Schema Conversion Tool, choose New Application from the Applications menu.
The New application conversion project dialog box appears.
Version 1.0
125
AWS Schema Conversion Tool User Guide
Creating Application Conversion Projects
2. Add the following project information.
For This Parameter
Application Project Name
Location
Project language
SQL parameter style for target database
Do This
Type a name for your application conversion project. Each database schema conversion project can have one or more child application conversion projects, so choose a name that makes sense if you add more projects later.
Type the location of the source code for your application.
Choose one of the following:
•
JAVA
•
C++
•
C#
•
Any
Choose one of the following:
•
Same as in source
•
Positional (?)
Version 1.0
126
AWS Schema Conversion Tool User Guide
Creating Application Conversion Projects
For This Parameter
Select source database schema
Do This
•
Indexed (:1)
•
Indexed ($1)
•
Named (@name)
•
Named (:name)
In the source tree, choose the schema used by your application code.
3. Choose OK to create your application conversion project.
The project window opens.
4. The first time you create an application conversion project, the project window opens automatically.
To open an existing application conversion project, select the project node in the source tree, open the context (right-click) menu, and then choose
Manage application.
Version 1.0
127
AWS Schema Conversion Tool User Guide
Analyzing and Converting Your SQL Code
5. You can add additional application conversion projects by choosing New Application from the
Applications menu, or by selecting the Applications node in the source tree, opening the context
(right-click) menu, and then choosing Add application.
Analyzing and Converting Your SQL Code by Using the AWS Schema Conversion Tool
Use the following procedure to analyze and convert your SQL code by using the AWS Schema Conversion
Tool (AWS SCT).
To analyze and convert your SQL code
1. In the application conversion project, choose Analyze.
AWS SCT analyzes your application code and extracts the SQL code. A list of all extracted SQL code appears in the Parsed SQL Scripts pane at the bottom of the window. The selected item in the list also appears in the Extracted SQL script pane.
2. You can analyze each SQL code item in the list, and when you are ready, choose Convert to convert the SQL to SQL for your target database.
Note
You can edit the converted SQL code in a later procedure.
Version 1.0
128
AWS Schema Conversion Tool User Guide
Creating and Using the Assessment Report
Creating and Using the Assessment Report
The application assessment report provides important information about converting the application
SQL code from your source database schema to your target database schema. The report details all of the SQL extracted from the application, all of the SQL converted, and action items for SQL that can't be converted. The report also includes estimates of the amount of effort that it will take to manually convert the SQL code that can't be converted automatically.
Creating an Application Assessment Report
Use the following procedure to create an application assessment report.
To create an application assessment report
1. In the application conversion project window, choose Create Report from the Actions menu.
The report is created and opens in the application conversion project window.
2. Review the Summary tab.
The Summary tab shown following, displays the summary information from the application assessment report. It shows the SQL code items that were converted automatically, and items that were not converted automatically.
3. Choose the SQL Conversion Actions tab and review the information.
Version 1.0
129
AWS Schema Conversion Tool User Guide
Editing and Saving Your Converted SQL Code
The SQL Conversion Actions tab contains a list of SQL code items that can't be converted automatically. There are also recommendations for how to manually convert the SQL code. You edit your converted SQL code in a later step. For more information, see
Converted SQL Code with the AWS Schema Conversion Tool (p. 130)
.
4. You can save a local copy of the application assessment report as either a PDF file or a commaseparated values (CSV) file. The PDF file contains both the summary and action item information.
The CSV file contains only action item information.
Editing and Saving Your Converted SQL Code with the AWS Schema Conversion Tool
The assessment report includes a list of SQL code items that can't be converted automatically. For each item that can't be converted, there is an action item on the
SQL Conversion Actions tab. For these items, you can edit the SQL code manually to perform the conversion.
Use the following procedure to edit your converted SQL code, apply the changes, and then save them.
To edit, apply changes to, and save your converted SQL code
1. Edit your converted SQL code directly in the Target SQL script pane. If there is no converted code shown, you can click in the pane and start typing.
2. After you are finished editing your converted SQL code, choose Apply. At this point, the changes are saved in memory, but not yet written to your file.
3. Choose Save to save your changes to your file.
Important
When you choose Save you overwrite your original file. Make a copy of your original file before saving so you have a record of your original application code.
Version 1.0
130
AWS Schema Conversion Tool User Guide
Storing AWS Credentials
Storing AWS Profiles in the AWS
Schema Conversion Tool
You can store your AWS credentials in the AWS Schema Conversion Tool (AWS SCT). AWS SCT uses your credentials when you use features that integrate with AWS services. For example, AWS SCT integrates with Amazon S3, AWS Lambda, and AWS Database Migration Service.
AWS SCT asks you for your AWS credentials when you access a feature that requires them. You can store your credentials in the global application settings. When AWS SCT asks for your credentials, you can select the stored credentials.
You can store different sets of AWS credentials in the global application settings. For example, you can store one set of credentials that you use in test scenarios, and a different set of credentials that you use in production scenarios. You can also store different credentials for different AWS regions.
Storing AWS Credentials
Use the following procedure to store AWS credentials globally.
To store AWS credentials
1. Start the AWS Schema Conversion Tool.
2. Open the Settings Menu, and then choose Global Settings. The Global settings dialog box appears.
Choose the AWS Service Profiles tab, as shown following.
Version 1.0
131
AWS Schema Conversion Tool User Guide
Setting the Default Profile for a Project
3. Choose Add new AWS Service Profile. A new row is added to the list of profiles.
4. Choose the edit icon to configure your profile.
a. For Profile name, type a name for your profile.
b. For AWS Access Key, type your AWS access key.
c.
For AWS Secret Key, type your AWS secret key.
d. For
Region, choose the region for your profile.
e. For S3 Bucket, choose the S3 bucket for your profile. You only need to specify a bucket if you are using a feature that connects to S3.
5. Choose Test Connection to verify that your credentials are correct and active.
6. After you have configured your profile, choose Save to save your profile. You can also choose Cancel to cancel your changes.
7. Choose
OK to close the Global Settings dialog box.
Setting the Default Profile for a Project
You can set the default profile for an AWS SCT project. Doing this associates the AWS credentials stored in the profile with the project. With your project open, use the following procedure to set the default profile.
Version 1.0
132
AWS Schema Conversion Tool User Guide
Related Topics
To set the default profile for a project
1. Start the AWS Schema Conversion Tool.
2. Open the Settings Menu, and then choose Project Settings. The Current project settings dialog box appears.
3. Choose the Project Environment tab.
4. For AWS Service Profile, choose the profile that you want to associate with the project.
5. Choose OK to close the Current project settings dialog box. You can also choose Cancel to cancel your changes.
Related Topics
•
The AWS Schema Conversion Tool Extension Pack and AWS Services for Databases (p. 84)
•
The AWS Schema Conversion Tool Extension Pack and Python Libraries for Data Warehouses (p. 108)
•
Working with the AWS Database Migration Service Using the AWS Schema Conversion Tool (p. 121)
Version 1.0
133
AWS Schema Conversion Tool User Guide
General Memory Management and Performance Options
Best Practices for the AWS Schema
Conversion Tool
Following, you can find information on best practices and options for using the AWS Schema Conversion
Tool (AWS SCT).
General Memory Management and Performance
Options
You can configure the AWS Schema Conversion Tool with different memory performance settings.
Increasing memory speeds up the performance of your conversion but uses more memory resources on your desktop.
To set your memory management option, choose Global Settings from the Settings menu, and choose the Performance and Memory tab. Choose one of the following options:
• Fast conversion, but large memory consumption – This option optimizes for speed of the conversion, but might require more memory for the object reference cache.
• Low memory consumption, but slower conversion – This option minimizes the amount of memory used, but results in a slower conversion. Use this option if your desktop has a limited amount of memory.
• Balance speed with memory consumption – This option optimizes provides a balance between memory use and conversion speed.
Configuring Additional Memory
For converting large database schemas, for example a database with 3,500 stored procedures, you can configure the amount of memory available to the AWS Schema Conversion Tool.
To modify the amount of memory AWS SCT consumes
1. Locate the folder where the configuration file is (C:\Program Files\AWS Schema Conversion Tool
\App).
Version 1.0
134
AWS Schema Conversion Tool User Guide
Related Topics
2. Open the configuration file
AWS Schema Conversion Tool.cfg
with Notepad or your favorite text editor.
3. Edit the
JVMUserOptions
section to set the minimum and maximum memory available. The following example sets the minimum to 4 GB and the maximum to 40 GB.
[JVMUserOptions]
-Xmx48960m
-Xms4096m
Related Topics
•
What Is the AWS Schema Conversion Tool? (p. 1)
•
Getting Started with the AWS Schema Conversion Tool (p. 11)
•
Installing and Updating the AWS Schema Conversion Tool (p. 6)
Version 1.0
135
AWS Schema Conversion Tool User Guide
Cannot load objects from an Oracle source database
Troubleshooting Issues with the AWS
Schema Conversion Tool
Following, you can find information about troubleshooting issues with the AWS Schema Conversion Tool
(AWS SCT).
Cannot load objects from an Oracle source database
When you attempt to load schema from an Oracle database, you might encounter one of the following errors.
Cannot load objects tree.
ORA-00942: table or view does not exist
These errors occur because the user whose ID you used to connect to the Oracle database doesn't have sufficient permissions to read the schema, as required by AWS SCT.
You can resolve the issue by granting the user select_catalog_role
permission and also permission to any dictionary in the database. These permissions provide the read-only access to the views and system tables that is required by AWS SCT. The following example creates a user ID named min_privs and grants the user with this ID the minimum permissions required to convert schema from an Oracle source database.
create user min_privs identified by min_privs; grant connect to min_privs; grant select_catalog_role to min_privs; grant select any dictionary to min_privs;
Related Topics
•
What Is the AWS Schema Conversion Tool? (p. 1)
Version 1.0
136
AWS Schema Conversion Tool User Guide
Related Topics
•
Getting Started with the AWS Schema Conversion Tool (p. 11)
•
Installing and Updating the AWS Schema Conversion Tool (p. 6)
Version 1.0
137
AWS Schema Conversion Tool User Guide
Related Topics
Keyboard Shortcuts for the AWS
Schema Conversion Tool
The following are the keyboard shortcuts that you can use with the AWS Schema Conversion Tool (AWS
SCT).
Keyboard Shortcut
Ctrl+N
Ctrl+O
Ctrl+S
Ctrl+W
Ctrl+L
Ctrl+R
Description
Create a new project.
Open an existing project.
Save an open project.
Create a new project by using the wizard.
Connect to the source database.
Connect to the target database.
Related Topics
•
What Is the AWS Schema Conversion Tool? (p. 1)
•
Getting Started with the AWS Schema Conversion Tool (p. 11)
•
Installing and Updating the AWS Schema Conversion Tool (p. 6)
Version 1.0
138
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to MySQL
Supported Schema Conversion
AWS Schema Conversion Tool
Reference
Following, you can find reference material for the AWS Schema Conversion Tool (AWS SCT):
•
MySQL to PostgreSQL Supported Schema Conversion (p. 212)
•
Oracle to MySQL Supported Schema Conversion (p. 241)
•
Oracle to PostgreSQL Supported Schema Conversion (p. 270)
•
PostgreSQL to MySQL Supported Schema Conversion (p. 212)
•
Microsoft SQL Server to MySQL Supported Schema Conversion (p. 139)
•
Microsoft SQL Server to PostgreSQL Supported Schema Conversion (p. 159)
Microsoft SQL Server to MySQL Supported
Schema Conversion
The following sections list the schema elements from Microsoft SQL Server and whether they are supported for automatic conversion to MySQL using the AWS Schema Conversion Tool.
Topics
•
•
•
•
•
•
•
Version 1.0
139
AWS Schema Conversion Tool User Guide
Statements
•
Data Definition Language (DDL) (p. 157)
•
•
Statements
Topics
•
•
•
•
SELECT
Clause
WITH
UNION
EXCEPT | INTERSECT
ALL | DISTINCT
TOP
<select_list>
INTO
FROM
WHERE
GROUP BY
HAVING
ORDER BY
FOR
OPTION
Automatically
Converted
Details
No Try converting the WITH(query) expression to a subquery and use it in a SELECT query.
Yes
No
Yes
Partial MySQL doesn't support TOP with the PERCENT or WITH
TIES options. Try using the LIMIT option or perform a manual conversion.
Yes
No
Partial MySQL doesn't support the CONTAINS and FREETEXT predicates in the FROM clause search condition.
Yes
Partial MySQL doesn't support ORDER BY with the ROLLUP,
CUBE, and GROUPING SETS options. Try creating a stored procedure to replace the query.
Yes
Partial MySQL doesn't support ORDER BY with the OFFSET or
FETCH options. Try creating a stored procedure to replace the query.
MySQL doesn't support ORDER BY with the COLLATE option. You must use the collation settings that were assigned when the database was created.
No
No
Version 1.0
140
AWS Schema Conversion Tool User Guide
Statements
INSERT
Clause
WITH
INSERT
TOP
INTO table_name
WITH
(<Table_Hint_Limited>)
OUTPUT
Yes
Yes
No
No
No
Automatically
Converted
Details
No Try to convert the WITH query to a subquery, and then use the subquery in the INSERT query.
Yes
No Get a count of all rows, and then use the following expression, where count_of_all_rows is your row count: percent_expression * count_of_all_rows / 100
Yes
Yes
No Use MySQL methods of performance tuning.
No Create a trigger for INSERT statements for the table, and then save the inserted rows in a temporary table.
After the INSERT operation, you can make use of the rows saved in the temporary table. This logic can be placed in a stored procedure.
Create a temporary table, fill it with the data to insert, and use the temporary table in the query.
VALUES derived_table execute_statement
<dml_table_source>
DEFAULT VALUES
UPDATE
Clause
WITH
TOP
WITH
(<Table_Hint_Limited>)
SET
OUTPUT
Automatically
Converted
Details
No
Partial
No
Try to convert the WITH query to a subquery, and then use the subquery in the UPDATE query.
MySQL doesn't support UPDATE with the PERCENT option. Get a count of all rows, and then use the following expression, where count_of_all_rows is your row count: percent_expression * count_of_all_rows / 100
Use MySQL methods of performance tuning.
No
No Create a trigger for UPDATE statements for the table, and then save the changed rows in a temporary table. After the UPDATE operation, you can make use of the rows
Version 1.0
141
AWS Schema Conversion Tool User Guide
Statements
Clause
FROM
WHERE
CURRENT OF
GLOBAL
OPTION
Automatically
Converted
Details
saved in the temporary table. This logic can be placed in a stored procedure.
Partial MySQL doesn't support a FROM clause. AWS Schema
Conversion Tool moves <table-source> to the UPDATE clause.
Yes
No Replace the CURRENT OF clause with an expression that consists of conditions that use unique key fields of the table.
No
No
Note
MySQL doesn't support FILESTREAM DATA. Perform a manual conversion to update the data in the file system file.
DELETE
Clause
WITH
TOP
FROM table_or_view_name rowset_function_limited
WITH
OUTPUT
WHERE
Yes
No
No
Automatically
Converted
Details
No
Partial
Try to convert the WITH query to a subquery, and then use the subquery in the DELETE query.
MySQL doesn't support the PERCENT option. A manual conversion is required. Get a count of all rows, and then use the following expression, where count_of_all_rows is your row count: percent_expression * count_of_all_rows /
100
Yes
No
MySQL doesn't support hints in DELETE statements, so the AWS Schema Conversion Tool skips options in the format WITH(Table_Hint_Limited). Use MySQL methods of performance tuning.
Create a trigger for DELETE statements for the table, and then save the deleted rows in a temporary table. After the DELETE operation, you can make use of the rows saved in the temporary table. This logic can be placed in a stored procedure.
Yes
Version 1.0
142
AWS Schema Conversion Tool User Guide
Procedures
Clause
CURRENT OF
GLOBAL
OPTION
Automatically
Converted
Details
No Replace the CURRENT OF clause with an expression that consists of conditions that use unique key fields of the table.
No
No
Procedures
Topics
•
CREATE PROCEDURE
Clause
@parameter
Automatically
Converted
Details
Yes MySQL doesn't support procedure arguments of the
CURSOR data type. Change the business logic to eliminate the need to send cursors through arguments to a stored procedure.
Partial VARYING
OUT
OUTPUT
READONLY
WITH
FOR REPLICATION
AS BEGIN … END
ENCRYPTION
RECOMPILE
EXECUTE AS
Yes
No
No
Partial
Partial
No
No
No
Flow Control
Clause
TRY…CATCH
THROW
Automatically
Converted
Details
No Try using the DECLARE HANDLER for the CATCH emulation block and the SIGNAL SQLSTATE operator to emulate the THROW operator.
Version 1.0
143
AWS Schema Conversion Tool User Guide
Functions
Clause
WAITFOR
DECLARE
GOTO
BREAK
CONTINUE
IF…ELSE
RETURN
WHILE
CASE
COALESCE
NULLIF
Yes
Yes
Yes
Yes
Yes
Yes
No
Automatically
Converted
Details
No Perform a manual conversion.
No
No
Perform a manual conversion.
Revise your code to eliminate GOTO operators, using
BEGIN...END blocks in combination with LEAVE, REPEAT,
UNTIL, and WHILE operators.
Yes
MySQL does not support returning a value from a procedure using the RETURN statement. To return a value, use the OUT parameter or a result set.
Functions
Topics
•
•
Date and Time Functions (p. 145)
•
Mathematical Functions (p. 146)
•
•
Configuration Functions (p. 148)
•
•
•
•
•
•
In this section, you can find a list of the Microsoft SQL Server built-in functions that indicates whether the AWS Schema Conversion Tool performs an automatic conversion. Where MySQL doesn't support a function, consider creating a user-defined function.
Aggregate Functions
Function
AVG
Automatically
Converted
Details
Yes
Version 1.0
144
AWS Schema Conversion Tool User Guide
Functions
Function
COUNT
COUNT_BIG
MIN
MAX
SUM
CHECKSUM_AGG
STDEV
STDEVP
GROUPING
GROUPING_ID
VAR
VARP
Automatically
Converted
Details
Yes
Partial
Yes
Yes
Yes
No
Partial
Partial
MySQL doesn't support the STDEV function with the
DISTINCT clause.
MySQL doesn't support the STDEVP function with the
DISTINCT clause.
No
No
Partial
Partial
MySQL doesn't support the VAR function with the
DISTINCT clause.
MySQL doesn't support the VARP function with the
DISTINCT clause.
Date and Time Functions
Function
DATEADD
DATEDIFF
DATENAME
DATEPART
DAY
GETDATE
GETDATE + 1
GETUTCDATE
MONTH
YEAR
Partial
Partial
Partial
Partial
Partial
Partial
Automatically
Converted
Details
Partial MySQL doesn't support the DATEADD function with the nanosecond datepart.
Partial
Partial
Partial
MySQL doesn't support the DATEDIFF function with the week, millisecond, or nanosecond datepart.
MySQL doesn't support the DATENAME function with the millisecond, nanosecond, or TZoffset datepart.
MySQL doesn't support the DATEPART function with the millisecond, nanosecond, or TZoffset datepart.
Version 1.0
145
AWS Schema Conversion Tool User Guide
Functions
Function Automatically
Converted
Details
DATETIMEOFFSETFROMPARTSNo
ISDATE
SWITCHOFFSET
SYSDATETIMEOFFSET
TODATETIMEOFFSET
No
No
No
No
LOG10
LOG
PI
POWER
RADIANS
RAND
ROUND
ABS
ACOS
ASIN
ATN2
ATAN
CEILING
COS
COT
DEGREES
EXP
FLOOR
Mathematical Functions
Function
SIGN
SIN
SQRT
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Partial
Yes
Yes
Yes
Yes
Yes
Yes
Automatically
Converted
Details
Yes
Yes
Yes
Partial
Yes
MySQL doesn't support the ROUND function with the function argument.
Version 1.0
146
AWS Schema Conversion Tool User Guide
Functions
Function
SQUARE
TAN
Automatically
Converted
Details
No
Yes
PATINDEX
QUOTENAME
REPLACE
REPLICATE
REVERSE
RIGHT
RTRIM
SOUNDEX
SPACE
STR
STUFF
SUBSTRING
UNICODE
UPPER
ASCII
CHAR
CHARINDEX
CONCAT
DIFFERENCE
FORMAT
LEFT
LEN
LOWER
LTRIM
NCHAR
String Functions
Function
No
Yes
No
No
Yes
No
Yes
No
Partial
Yes
Partial
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Partial
Automatically
Converted
Details
Yes
Yes
No
Yes
No
Version 1.0
147
AWS Schema Conversion Tool User Guide
Functions
Configuration Functions
Function
@@DATEFIRST
@@DBTS
@@LANGID
@@LANGUAGE
@@LOCK_TIMEOUT
@@MAX_CONNECTIONS
@@MAX_PRECISION
@@NESTLEVEL
@@OPTIONS
@@REMSERVER
@@SERVERNAME
@@SERVICENAME
@@SPID
@@TEXTSIZE
@@VERSION
Yes
No
Yes
No
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Automatically
Converted
Details
No
Yes
Conversion Functions
Function
CAST and CONVERT
PARSE
TRY_CAST
TRY_CONVERT
TRY_PARSE
Automatically
Converted
Details
No
No
No
No
No
Security Functions
Function
CERTENCODED
CERTPRIVATEKEY
Automatically
Converted
Details
Yes
Yes
Version 1.0
148
AWS Schema Conversion Tool User Guide
Functions
Function
CURRENT_USER
DATABASE_PRINCIPAL_ID
HAS_PERMS_BY_NAME
IS_MEMBER
IS_ROLEMEMBER
IS_SRVROLEMEMBER
ORIGINAL_LOGIN
PERMISSIONS
PWDCOMPARE
PWDENCRYPT
SCHEMA_ID
SCHEMA_NAME
SESSION_USER
SUSER_ID
SUSER_NAME
SUSER_SID
SUSER_SNAME sys.fn_builtin_permissions
Yes sys.fn_get_audit_file Yes sys.fn_my_permissions
Yes
SYSTEM_USER
USER_ID
USER_NAME
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Automatically
Converted
Details
No
No
Yes
Yes
System Functions
Function
$PARTITION
@@ERROR
@@IDENTITY
@@PACK_RECEIVED
Automatically
Converted
Details
Yes
Yes
Yes
Yes
Version 1.0
149
AWS Schema Conversion Tool User Guide
Functions
Function
@@ROWCOUNT
@@TRANCOUNT
BINARY_CHECKSUM
CHECKSUM
CONNECTIONPROPERTY
CONTEXT_INFO
CURRENT_REQUEST_ID
ERROR_LINE
ERROR_MESSAGE
ERROR_NUMBER
ERROR_PROCEDURE
ERROR_SEVERITY
ERROR_STATE
FORMATMESSAGE
No
No
No
Yes
Yes
Yes
No
No
No
No
Automatically
Converted
Details
Yes
Yes
Yes
No
GETANSINULL
HOST_ID
Yes
No
HOST_NAME
ISNULL
No
No
MIN_ACTIVE_ROWVERSION Yes
NEWID
NEWSEQUENTIALID
PARSENAME
ROWCOUNT_BIG
XACT_STATE
Yes
Yes
Yes
Yes
Yes
Logical Functions
Function
CHOOSE
IIF
Automatically
Converted
Details
No
No
Version 1.0
150
AWS Schema Conversion Tool User Guide
Operators
CREATE FUNCTION
Clause
@parameter_name type_schema_name parameter_data_type
= default
READONLY No
RETURNS return_data_type No
WITH function_option Yes
BEGIN … END No
RETURN scalar_expression Yes
Automatically
Converted
Details
Yes
Yes
No
Yes
MySQL supports only functions that return a scalar value.
EXECUTE
Clause
@parameter_name type_schema_name parameter_data_type
= default
No
Yes
READONLY No
RETURNS return_data_type No
Automatically
Converted
Details
Yes
Yes
WITH function_option
BEGIN … END
Yes
No
RETURN scalar_expression Yes MySQL supports only functions that return a scalar value.
Operators
Topics
•
•
•
•
•
•
•
String Concatenation Operator (p. 154)
Version 1.0
151
AWS Schema Conversion Tool User Guide
Operators
•
*
-
-=
+
+=
*=
/
/=
%
Arithmetic Operators
Clause
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Automatically
Converted
Details
Yes
Yes
Assignment Operator
Clause
=
Automatically
Converted
Details
Yes
^
~
|
&
Bitwise Operators
Clause Automatically
Converted
Details
Yes
Yes
Yes
Yes
=
>
<
Comparison Operators
Clause Automatically
Converted
Details
Yes
Yes
Yes
Version 1.0
152
AWS Schema Conversion Tool User Guide
Operators
Clause
>=
!<
!>
<=
<>
!=
Automatically
Converted
Details
Yes
Yes
Yes
Yes
Yes
Yes
ALL
AND
ANY
BETWEEN
EXISTS
IN
LIKE
NOT
OR
SOME
Logical Operators
Clause
Yes
Yes
Yes
Yes
Yes
Partial
Automatically
Converted
Details
Yes
Yes
Yes
Yes
The AWS Schema Conversion Tool converts SOME to ANY.
Set Operators
Clause
UNION
UNION ALL
EXCEPT
INTERSECT
Automatically
Converted
Details
Yes
Yes
No
No
Perform a manual conversion.
Perform a manual conversion.
Version 1.0
153
AWS Schema Conversion Tool User Guide
Transactions
String Concatenation Operator
Clause
+
Automatically
Converted
Details
Yes
-
+
Unary Operators
Clause Automatically
Converted
Details
Yes
Yes
Transactions
Topics
•
BEGIN TRANSACTION
Clause
DISTRIBUTED transaction_name
WITH MARK
SAVE
ROLLBACK transaction_name savepoint_name
COMMIT
DELAYED_DURABILITY
Automatically
Converted
Details
No MySQL doesn't support distributed transactions. Revise your architecture so that it doesn't use distributed transactions.
No
No
MySQL doesn't support named transactions. Revise your code to eliminate marked transactions.
MySQL doesn't support the WITH MARK option. Revise your code to eliminate marked transactions.
Partial
Partial
No MySQL doesn't support named transactions. Revise your code to eliminate named transactions.
Partial
Partial
No
Data Types
Topics
Version 1.0
154
AWS Schema Conversion Tool User Guide
Data Types bigint int smallint tinyint bit money smallmoney numeric decimal float real
•
•
•
•
•
Numerics
Data type
Yes
Yes
Yes
Yes
Yes
Yes
Automatically
Converted
Default Conversion
Yes bigint
Yes
Yes
Yes
Yes int smallint tinyint unsigned bit(1) numeric(19,4) numeric(10,4) numeric decimal double float
Date and Time
Data type
date datetime2(7)
Automatically
Converted
Default Conversion
Partial date
Partial datetime datetime Partial datetime datetimeoffset(7) smalldatetime time(7)
No
Yes
Yes datetime time
Details
Details
0001-01-01 through
9999-12-31
0001-01-01 through
9999-12-31 00:00:00 through 23:59:59.9999999
1753-01-01, through
9999-12-31 00:00:00 through 23:59:59.997
Version 1.0
155
AWS Schema Conversion Tool User Guide
Data Types
Character Strings
Data type
char(len)
Automatically
Converted
Default Conversion
Partial char varchar(len) varchar(max) text nchar(len) nvarchar(len) nvarchar(max) ntext
Yes
Yes
Yes len = 1 -
4000
Yes
Yes
Yes varchar longtext longtext char varchar longtext longtext
Binary Strings
Data type
binary(len) varbinary(len) varbinary(max) hierarchyid sql_variant table uniqueidentifier xml geography geometry
Special Types
Data type
UNIQUEIDENTIFIER
DOUBLE PRECISION
IDENTITY
No
No
No
No
No
Yes
No
No
Automatically
Converted
Default Conversion
Yes
Yes blob blob longblob
Details
len= 1 - 255 (2^8 - 1) symbols (loss range) len= 1 - 255 (2^8 - 1) symbols (loss range)
Details
Automatically
Converted
Default Conversion
Partial
Partial
CHAR(38) OR BINARY(16)
FLOAT(53)
Partial AUTO_INCREMENT
Version 1.0
156
Details
AWS Schema Conversion Tool User Guide
Data Definition Language (DDL)
Data type
SYSNAME
Automatically
Converted
Default Conversion
Partial NVARCHAR(128) NOT NULL
Details
Data Definition Language (DDL)
Topics
•
•
•
•
CREATE TABLE
CREATE TABLE statements are converted automatically except for the following clause.
Clause
SET DEFAULT
Automatically
Converted
Details
No MySQL doesn't support the SET DEFAULT option for
FOREIGN KEY.
CREATE INDEX
The AWS Schema Conversion Tool does not support automatic migration of data definition language
(DDL) code to create an index.
CREATE TRIGGER
CREATE TRIGGER statements are converted automatically except for the following clause.
Clause
FOR
Automatically
Converted
Details
No MySQL doesn't support a FOR clause in a CREATE
TRIGGER statement.
CREATE VIEW
CREATE VIEW statements are converted automatically except for the following clauses.
Clause
SCHEMABINDING
ENCRYPTION
VIEW_METADATA
Automatically
Converted
Details
No
No
AWS Schema Conversion Tool ignores this clause.
AWS Schema Conversion Tool ignores this clause.
No AWS Schema Conversion Tool ignores this clause.
Version 1.0
157
AWS Schema Conversion Tool User Guide
Cursors
Cursors
Topics
•
DECLARE CURSOR
Clause
LOCAL
GLOBAL
FORWARD_ONLY
SCROLL
STATIC
KEYSET
DYNAMIC
FAST_FORWARD
READ_ONLY
SCROLL_LOCKS
OPTIMISTIC
TYPE_WARNING
Automatically
Converted
Details
Yes
No
Partial
Change the global cursor to a local cursor, or revise your code so it doesn't require global cursors.
Setting this option corresponds to the typical behavior of cursors in MySQL, so the AWS Schema Conversion Tool skips this option during conversion.
Revise your code to eliminate cursors with the SCROLL option.
No
Yes The membership and order of rows never changes for cursors in MySQL, so the AWS Schema Conversion Tool skips this option during conversion. Verify that the converted schema behavior is acceptable.
Partial
No
Yes
Yes
Partial
Partial
Partial
Revise your code to eliminate dynamic cursors.
Setting this option corresponds to the typical behavior of cursors in MySQL, so the AWS Schema Conversion Tool skips this option during conversion.
All MySQL cursors are read-only, so the AWS Schema
Conversion Tool skips this option during conversion.
MySQL doesn't support the option SCROLL_LOCKS, so the AWS Schema Conversion Tool ignores this option during conversion. Verify that the converted schema behavior is acceptable.
MySQL doesn't support the option OPTIMISTIC, so the
AWS Schema Conversion Tool ignores this option during conversion. Verify that the converted schema behavior is acceptable.
MySQL doesn't support the option TYPE_WARNING, so the AWS Schema Conversion Tool ignores this option during conversion. Verify that the converted schema behavior is acceptable.
Change the global cursor to a local cursor, or revise your code so it doesn't require global cursors.
Version 1.0
158
AWS Schema Conversion Tool User Guide
Related Topics
Related Topics
•
What Is the AWS Schema Conversion Tool? (p. 1)
•
Getting Started with the AWS Schema Conversion Tool (p. 11)
•
Installing and Updating the AWS Schema Conversion Tool (p. 6)
Microsoft SQL Server to PostgreSQL Supported
Schema Conversion
The following sections list the schema elements from a Microsoft SQL Server database and whether they are supported for automatic conversion to PostgreSQL using the AWS Schema Conversion Tool.
Data Definition Language (DDL)
Naming Objects
Clause
Schemas
Tables, Columns
Automatically
Converted
Details
Yes
Yes
Statements
Clause
ALTER INDEX
ALTER PROCEDURE
ALTER TRIGGER
ALTER VIEW
CREATE FUNCTION
CREATE PROCEDURE
CREATE SEQUENCE
IDENTITY (x,y)
TRUNCATE TABLE
UPDATE STATISTICS
Yes
Yes
No
No
No
No
Automatically
Converted
Details
No
Partial Automatic migration of inline functions is not supported.
Default parameters specified for any function are skipped.
Yes
Yes
Version 1.0
159
AWS Schema Conversion Tool User Guide
Data Definition Language (DDL)
ALTER TABLE
Clause Automatically
Converted
Details
Yes ADD
ALTER COLUMN
DROP COLUMN
DROP CONSTRAINT
ENABLE/DISABLE TRIGGER Yes
No
No
No
CREATE INDEX
Clause
CLUSTER option
COLUMNSTORE index
INCLUDE clause
Other INDEX options
SPATIAL index
UNIQUE option
XML index
Automatically
Converted
Details
Partial
Partial
Partial
Partial
Partial
Yes
Partial
CREATE TABLE
Clause
Partitioned tables
Regular tables
Temporary tables
Wide tables
Automatically
Converted
Details
Yes
Yes
Partial
Yes
CREATE TRIGGER
Clause Automatically
Converted
Details
Partial FOR EACH STATEMENT
Triggers
INSTEAD OF Triggers Partial
Version 1.0
160
AWS Schema Conversion Tool User Guide
Data Manipulation Language (DML)
Clause
Trigger event (INSERT/
UPDATE/DELETE )
Trigger time (BEGORE/
AFTER)
CREATE VIEW
Clause
CREATE VIEW
Updatable Views
VIEW
Automatically
Converted
Details
Partial
Partial
Automatically
Converted
Details
Yes
Yes
Yes
DROP Statements
Clause
DROP TABLE
DROP VIEW
Other types of objects
Automatically
Converted
Details
Yes
Yes
Yes
Data Manipulation Language (DML)
Clause for Statements
Clause
Join Hints
Query Hints
Table Hint
WHERE
Automatically
Converted
Details
No
No
No
Yes
Version 1.0
161
AWS Schema Conversion Tool User Guide
Data Manipulation Language (DML)
Joins
Cross Joins
Clause
Cross join
Cross join with condition
Inner Joins
Clause
Inner Joins
Outer Joins
Automatically
Converted
Details
Yes
Yes
Automatically
Converted
Details
Yes
Clause
Full join
Full outer join
Left join
Left outer join
Right join
Right outer join
Yes
Yes
Yes
Automatically
Converted
Details
Yes
Yes
Yes
Predicates for Statements
Clause
Boolean conditions
Exists conditions
In conditions
Null conditions
Pattern matching conditions
Range conditions
Automatically
Converted
Details
Yes
Yes
Yes
Yes
Yes
Yes
Version 1.0
162
AWS Schema Conversion Tool User Guide
Data Manipulation Language (DML)
Comparison Conditions
Clause
=, <>, <, <=, >, >=
ANY, SOME, ALL
Automatically
Converted
Details
Yes
Partial
Statements
DELETE
Clause
CURRENT OF
FROM
OUTPUT
TOP
VALUES
WITH
No
Yes
Yes
Automatically
Converted
Details
Yes
Partial
Partial
INSERT
Clause
DEFAULT
DEFAULT VALUES
FROM
INTO
OUTPUT
TOP
VALUES
WITH
Yes
No
No
Yes
Yes
Automatically
Converted
Details
Yes
Yes
Yes
SELECT
Clause
GROUP BY clause with an expression
Automatically
Converted
Details
Yes
Version 1.0
163
AWS Schema Conversion Tool User Guide
Data Manipulation Language (DML)
Clause Automatically
Converted
Details
Yes GROUP BY clause with multiple tables
GROUP BY CUBE
Group By Grouping Sets
GROUP BY ROLLUP
Limiting the number of rows returned
Select all columns (using the * and aliases)
Select all columns (using the *)
Select subset of the columns
Yes
Yes
Yes
Select with calculations Yes
Select with column heading Yes
Select with constants Yes
Specifying a ascending order
Specifying a collation
Yes
Yes
Yes Specifying a conditional order
Specifying a descending order
Yes
Yes
Yes
Specifying a percentage
Specifying a percentage
(argument 100 percent)
Specifying an alias as the sort column
Specifying an expression as the sort column
Specifying both ascending and descending order
TOP with a variable
Using ORDER BY and
OFFSET command
Yes
Yes
Yes
Yes
Yes
No
No
No
Yes
Version 1.0
164
AWS Schema Conversion Tool User Guide
Data Manipulation Language (DML)
Clause
Using ORDER BY in a ranking function
Using ORDER BY with
UNION
Using WITH TIES
WHERE with BETWEEN
WHERE with combination of predicates
Automatically
Converted
Details
Yes
Yes
No
Yes
Yes
WHERE with CONTAINS
WHERE with EXISTS subquery
No
Yes
WHERE with FREETEXT No
WHERE with IN custom list Yes
WHERE with IN subquery Yes
WHERE with LIKE
WHERE with negates a
Boolean input
WHERE with NULL
Partial
Yes
Yes
DISTINCT
Clause
DISTINCT
FROM
Clause
FROM
Automatically
Converted
Details
Yes
Automatically
Converted
Details
Yes
GROUP BY
Clause
GROUP BY
Automatically
Converted
Details
Yes
Version 1.0
165
HAVING
Clause
HAVING
ORDER BY
Clause
ORDER BY
TOP
Clause
TOP
WHERE
Clause
WHERE
UPDATE
Clause
CURRENT OF
DEFAULT
FILESTREAM Data
FROM
OUTPUT
TOP
VALUES
WITH
AWS Schema Conversion Tool User Guide
Data Manipulation Language (DML)
Automatically
Converted
Details
Yes
Automatically
Converted
Details
Yes
Automatically
Converted
Details
Yes
Automatically
Converted
Details
Yes
No
Yes
Yes
Automatically
Converted
Details
Yes
Yes
No
Yes
Partial
Version 1.0
166
AWS Schema Conversion Tool User Guide
Data Types
Data Types
Clause
BIGINT
BINARY
BIT
CHAR, CHARACTER
DATETIME
DATETIMEOFFSET
DEC, DECIMAL
DOUBLE PRECISION
FLOAT
GEOGRAPHY
GEOMETRY
HIERARCHYID
IDENTITY
INT, INTEGER
MONEY
NCHAR
NTEXT
NUMERIC
NVARCHAR
REAL
ROWVERSION
SMALL MONEY
SMALLDATETIME
SMALLINT
SQL_VARIANT
SYSNAME
TABLE
TEXT
TIMESTAMP
Yes
Yes
No
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Automatically
Converted
Details
Yes
Yes
Version 1.0
167
AWS Schema Conversion Tool User Guide
Database Mail
Clause
TINYINT
UNIQUEIDENTIFIER
VARBINARY
VARCHAR
XML
Yes
Yes
No
Automatically
Converted
Details
Yes
Yes Converted to a universally unique identifier (UUID) if the
PostgreSQL instance has the uuid-ossp module installed.
The uuid-ossp module provides functions to generate
UUIDs using one of several standard algorithms.
Database Mail
Clause
Accounts and Profiles
Database Mail
Configuration Objects
Database Mail Messaging
Objects
Database Mail Settings
Security sp_send_dbmail sysmail_add_account_sp
Yes
Yes
No
No
Automatically
Converted
Details
Yes
Yes
Yes sysmail_add_profile_sp No sysmail_add_profileaccount_spNo sysmail_allitems sysmail_configure_sp
No
No sysmail_delete_account_sp No sysmail_delete_log_sp No sysmail_delete_mailitems_sp No sysmail_delete_profile_sp No sysmail_event_log No
Version 1.0
168
AWS Schema Conversion Tool User Guide
Functions
Clause
sysmail_faileditems sysmail_help_account_sp No sysmail_help_configure_sp No
Automatically
Converted
Details
No sysmail_help_profile_sp No sysmail_help_queue_sp sysmail_help_status_sp sysmail_help_status_sp sysmail_mailattachments sysmail_sentitems sysmail_start_sp sysmail_start_sp sysmail_stop_sp sysmail_stop_sp sysmail_unsentitems
No
No sysmail_update_account_sp No
No
No
No
No
No
No
No
No sysmail_update_profile_sp No
Yes System State
Functions
@@functions
Clause
@@CONNECTIONS
@@CPU_BUSY
@@CURSOR_ROWS
Automatically
Converted
Details
No
No
No
Version 1.0
169
AWS Schema Conversion Tool User Guide
Functions
Clause
@@DATEFIRST
@@DBTS
@@ERROR
@@FETCH_STATUS
@@IDENTITY
@@IDLE
@@IO_BUSY
@@LANGID
@@LANGUAGE
@@LOCK_TIMEOUT
@@MAX_CONNECTIONS
@@MAX_PRECISION
@@NESTLEVEL
@@OPTIONS
@@PACK_RECEIVED
@@PACK_SENT
@@PACKET_ERRORS
@@PROCID
@@REMSERVER
@@ROWCOUNT
@@SERVERNAME
@@SERVICENAME
@@SPID
@@TEXTSIZE
@@TIMETICKS
@@TOTAL_ERRORS
@@TOTAL_READ
@@TOTAL_WRITE
@@TRANCOUNT
@@VERSION
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
Automatically
Converted
Details
No
No
No
Yes
Version 1.0
170
AWS Schema Conversion Tool User Guide
Functions
Aggregate
Clause
AVG
CHECKSUM_AGG
COUNT
COUNT_BIG
GROUPING
GROUPING_ID
MAX
MIN
STDEV
STDEVP
SUM
VAR
VARP
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
Automatically
Converted
Details
Partial
No
Yes
Yes
No
Built-in Functions
Clause
Aggregate Functions
Cursor Functions
Metadata Functions
Security Functions
System Functions
System Statistical
Functions
Text and Image Functions
Automatically
Converted
Details
Yes
No
No
No
No
No
No
Conversion
Clause
CAST
Automatically
Converted
Details
Partial
Version 1.0
171
AWS Schema Conversion Tool User Guide
Functions
Clause
CONVERT
PARSE
TRY_CAST
TRY_CONVERT
TRY_PARSE
No
No
No
Automatically
Converted
Details
Partial
No
Date and Time
Clause
CURRENT_TIMESTAMP
DATEADD
DATEDIFF
DATEFROMPARTS
DATENAME
DATEPART
DATETIME2FROMPARTS
DATETIMEFROMPARTS
Partial
Partial
Partial
DATETIMEOFFSETFROMPARTSPartial
DAY Yes
EOMONTH Yes
Automatically
Converted
Details
Partial
Partial
Partial
Yes
Partial
GETDATE
GETUTCDATE
ISDATE
MONTH
SMALLDATETIMEFROMPARTS Yes
SWITCHOFFSET No
SYSDATETIME Yes
Yes
Yes
No
Yes
SYSDATETIMEOFFSET
SYSUTCDATETIME
TIMEFROMPARTS
TODATETIMEOFFSET
No
Yes
Yes
No
Version 1.0
172
AWS Schema Conversion Tool User Guide
Functions
Clause
YEAR
Automatically
Converted
Details
Yes
LOG10()
PI()
POWER()
RADIANS()
RAND()
RAND(seed)
ROUND()
ROUND()
SIGN()
SIN()
SQRT()
SQUARE()
TAN()
ABS()
ACOS()
ASIN()
ATAN()
ATN2 ()
CEILING()
COS()
COT()
DEGREES()
EXP()
FLOOR()
LOG()
Mathematical Functions
Clause
Yes
Yes
Yes
Yes
Partial
Partial
Yes
Yes
Yes
Yes
Yes
Yes
Partial
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Automatically
Converted
Details
Yes
Yes
Version 1.0
173
AWS Schema Conversion Tool User Guide
Functions
Ranking Functions
Clause
DENSE_RANK
NTILE
RANK
ROW_NUMBER
Automatically
Converted
Details
Yes
Yes
Yes
Yes
Rowset Functions
Clause
CONTAINSTABLE
FREETEXTTABLE
OPENDATASOURCE
OPENQUERY
OPENROWSET
OPENXML
No
No
No
No
Automatically
Converted
Details
No
No
Scalar Functions
Clause
ABS()
ACOS()
ASCII
ASIN()
ATAN()
ATN2 ()
AVG
CEILING()
CHAR
CHARINDEX
CHECKSUM
CHECKSUM_AGG
Yes
Yes
No
Yes
Yes
Yes
No
Automatically
Converted
Details
Yes
Yes
Yes
Yes
Yes
Version 1.0
174
AWS Schema Conversion Tool User Guide
Functions
Clause
CHOOSE
CONCAT
COS()
COT()
COUNT
COUNT_BIG
CURRENT_TIMESTAMP
CURRENT_USER
DATABASE_PRINCIPAL_ID
DATEADD
DATEDIFF
DATEFROMPARTS
DATENAME
DATEPART
DATETIME2FROMPARTS
DATETIMEFROMPARTS
Yes
Yes
DATETIMEOFFSETFROMPARTSNo
Partial
Yes
Partial
Partial
DAY
DEGREES()
DIFFERENCE
EOMONTH
ERROR_LINE
ERROR_MESSAGE
Yes
No
No
Yes
Yes
No
ERROR_NUMBER
ERROR_PROCEDURE
ERROR_SEVERITY
ERROR_STATE
EXP()
FLOOR()
FORMAT
Yes
Yes
No
No
No
No
No
Yes
Yes
Yes
No
No
Partial
Automatically
Converted
Details
No
Yes
Yes
Yes
Version 1.0
175
Clause
FORMATMESSAGE
GETDATE
GETUTCDATE
GROUPING
GROUPING_ID
HOST_ID
HOST_NAME
IIF
ISDATE
ISNULL
ISNUMERIC
LEFT
LEN
LOG()
LOG10()
LOWER
LTRIM
MAX
MIN
MONTH
NCHAR
ORIGINAL_LOGIN
PARSENAME
PATINDEX
PI()
POWER()
QUOTENAME
RADIANS()
AWS Schema Conversion Tool User Guide
Functions
No
Yes
Yes
Yes
Partial
Yes
No
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Implemented in Extension
Library
Yes
Yes
No
No
Yes
No
No
No
Automatically
Converted
Details
No
Yes
Yes
No
Version 1.0
176
AWS Schema Conversion Tool User Guide
Functions
Clause
RAND()
REPLACE
REPLICATE
REVERSE
RIGHT
ROUND()
RTRIM
SCHEMA_NAME
SESSION_USER
SIGN()
SIN() Yes
SMALLDATETIMEFROMPARTS Yes
SOUNDEX
SPACE
Yes
Yes
SQRT()
SQUARE()
STDEV
Yes
Yes
Yes
STDEVP
STR
STUFF
SUBSTRING
SUM
SWITCHOFFSET
Yes
Yes
No
Yes
No
Yes
SYSDATETIME
SYSDATETIMEOFFSET
SYSUTCDATETIME
TAN()
TIMEFROMPARTS
TODATETIMEOFFSET
UNICODE
Yes
No
No
Yes
No
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Automatically
Converted
Details
Yes
Yes
Yes
Yes
Version 1.0
177
Clause
UPPER
VAR
VARP
YEAR
String
Clause
QUOTENAME
REPLACE
REPLICATE
REVERSE
RIGHT
RTRIM
SOUNDEX
SPACE
STR
STUFF
SUBSTRING
ASCII
CHAR
CHARINDEX
CONCAT
DIFFERENCE
FORMAT
LEFT
LEN
LOWER
LTRIM
NCHAR
PATINDEX
AWS Schema Conversion Tool User Guide
Functions
Automatically
Converted
Details
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
No
Yes
Yes
No
No
Partial
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Automatically
Converted
Details
Yes
Yes
Yes
Version 1.0
178
AWS Schema Conversion Tool User Guide
Operators
Clause
UNICODE
UPPER
Automatically
Converted
Details
No
Yes
Operators
Arithmetic Operators
Clause
- (Subtract)
% (Modulo)
* (Multiply)
/ (Divide)
+ (Add)
Automatically
Converted
Details
Partial
Partial
Partial
Partial
Partial
Assignment Operator
Clause
=
Automatically
Converted
Details
Yes
Bitwise Operators
Clause
& (Bitwise AND)
^ (Bitwise Exclusive OR)
| (Bitwise OR)
Automatically
Converted
Details
Yes
No
Yes
Comparison Operators
Clause
Comparison Operators
Automatically
Converted
Details
Partial
Version 1.0
179
AWS Schema Conversion Tool User Guide
Other
Logical Operators
Clause
Logical Operators
Automatically
Converted
Details
Yes
Set Operators
Clause
EXCEPT
INTERSECT
UNION
UNION ALL
Automatically
Converted
Details
Yes
Yes
Yes
Yes
String Concatenation Operator
Clause
String Concatenation
Operator
Automatically
Converted
Details
Yes
Unary Operators
Clause
Unary Operators
Automatically
Converted
Details
Yes
Other
Clause
CHECKSUM
CHOOSE
CURRENT_USER
DATABASE_PRINCIPAL_ID
ERROR_LINE
ERROR_MESSAGE
ERROR_NUMBER
No
No
No
No
Automatically
Converted
Details
No
No
No
Version 1.0
180
AWS Schema Conversion Tool User Guide
Service Broker
Clause
ERROR_PROCEDURE
ERROR_SEVERITY
ERROR_STATE
FORMATMESSAGE
HOST_ID
HOST_NAME
IIF
ISNULL
ISNUMERIC
Logical Functions
NEWID
ORIGINAL_LOGIN
Other
SCHEMA_NAME
Security Functions
SESSION_USER
System Functions
No
Yes
No
Yes
No
Yes
Yes
Yes
Yes
No
Yes
No
No
No
No
No
No
Automatically
Converted
Details
No
Service Broker
Clause
ALTER QUEUE
ALTER SERVICE
BEGIN CONVERSATION
TIMER
BEGIN DIALOG
CONVERSATION
CREATE QUEUE
CREATE SERVICE
DROP QUEUE
No
No
No
Automatically
Converted
Details
No
No
No
No
Version 1.0
181
AWS Schema Conversion Tool User Guide
Service Broker
Clause
DROP SERVICE
END CONVERSATION
GET CONVERSATION
GROUP
GET
TRANSMISSION_STATUS
MOVE CONVERSATION
Queue management
RECEIVE
No
SEND
Service Broker Catalog
Views
No
Yes
Service Broker Related
Dynamic Management
Views
Yes
Service Broker Statements Yes
No
Yes
No
Automatically
Converted
Details
No
No
No
Service management Yes sys.conversation_endpoints No sys.conversation_groups
No sys.conversation_priorities
No sys.dm_broker_activated_tasksNo
sys.dm_broker_connections No sys.remote_service_bindings No sys.routes
No sys.service_contract_usages No sys.service_contracts
No sys.service_message_types
No sys.service_queue_usages
No sys.service_queues
No
Version 1.0
182
AWS Schema Conversion Tool User Guide
SQL Server Agent
Clause
sys.services
sys.transmission_queue
Automatically
Converted
Details
No
No
SQL Server Agent
Clause
sp_add_alert sp_add_category sp_add_job sp_add_jobschedule sp_add_jobserver sp_add_jobstep sp_add_notification sp_add_operator sp_add_proxy sp_add_schedule
No
No sp_add_targetservergroup No
No
No
No
No
No
No
No
Automatically
Converted
Details
No sp_add_targetsvrgrp_memberNo sp_apply_job_to_targets No sp_attach_schedule No sp_cycle_agent_errorlog sp_cycle_errorlog sp_delete_alert sp_delete_category
No
No
No
No sp_delete_job sp_delete_jobschedule sp_delete_jobserver sp_delete_jobstep sp_delete_jobsteplog sp_delete_notification sp_delete_operator
No
No
No
No
No
No
No
Version 1.0
183
AWS Schema Conversion Tool User Guide
SQL Server Agent
Clause
sp_delete_proxy sp_delete_schedule sp_delete_targetserver
No
No sp_delete_targetservergroup No
Automatically
Converted
Details
No sp_detach_schedule sp_enum_login_for_proxy
No
No sp_grant_login_to_proxy No sp_grant_proxy_to_subsystemNo sp_help_alert No sp_help_category sp_help_downloadlist
No
No sp_help_job sp_help_jobactivity sp_help_jobcount sp_help_jobhistory sp_help_jobs_in_schedule sp_help_jobschedule
No
No
No
No
No
No sp_help_jobserver sp_help_jobstep sp_help_jobsteplog sp_help_notification sp_help_operator sp_help_proxy sp_help_schedule sp_help_targetserver No sp_help_targetservergroup No sp_manage_jobs_by_login No
No
No
No
No
No
No
No
Version 1.0
184
AWS Schema Conversion Tool User Guide
SQL Server Backup
Clause
sp_msx_defect sp_msx_enlist sp_msx_get_account sp_msx_set_account sp_notify_operator sp_post_msx_operation sp_purge_jobhistory sp_remove_job_from_targetssNo sp_resync_targetserver No sp_revoke_login_from_proxy No
No
No
No
No
No
No
Automatically
Converted
Details
No sp_start_job sp_stop_job sp_update_alert sp_update_category sp_update_job sp_update_jobschedule sp_update_jobstep sp_update_notification sp_update_operator sp_update_proxy sp_update_schedule
No
No sp_update_targetservergroup No
No
No
No
No
No
No
No
No
No
SQL Server Backup
Clause
BACKUP
BACKUP CERTIFICATE
BACKUP MASTER KEY
Automatically
Converted
Details
No
No
No
Version 1.0
185
AWS Schema Conversion Tool User Guide
T-SQL
Clause
BACKUP SERVICE MASTER
KEY
RESTORE
RESTORE FILELISTONLY
RESTORE HEADERONLY
RESTORE LABELONLY
RESTORE MASTER KEY
RESTORE REWINDONLY
RESTORE SERVICE MASTER
KEY
RESTORE VERIFYONLY
Automatically
Converted
Details
No
No
No
No
No
No
No
No
No
T-SQL
BACKUP and RESTORE
Clause
BACKUP and RESTORE
Statements
Automatically
Converted
Details
No
Collation
Clause
Collation
Automatically
Converted
Details
No
Control-of-Flow Language
Clause
BEGIN...END
BREAK
CONTINUE
GOTO
IF...ELSE
Automatically
Converted
Details
Yes
Yes
Yes
No
Yes
Version 1.0
186
AWS Schema Conversion Tool User Guide
T-SQL
Clause
RETURN
THROW
TRY...CATCH
WAITFOR
WHILE
Cursors
DECLARE CURSOR
Clause
DECLARE CURSOR
CURSOR with option
GLOBAL
CURSOR with options
FORWARD_ONLY or
SCROLL
Automatically
Converted
Details
Yes
Yes
Yes
Partial
Yes
Automatically
Converted
Details
Yes
No
No
FETCH
Clause
FETCH
OPEN
Clause
OPEN
Automatically
Converted
Details
Yes
Automatically
Converted
Details
Yes
DUMP and LOAD Statements
Clause
DUMP and LOAD
Statements
Automatically
Converted
Details
No
Version 1.0
187
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
Microsoft SQL Server to PostgreSQL Conversion Issue
Reference
Use the following sections to get information on the types of issues you might encounter during a
Microsoft SQL Server to PostgreSQL conversion. Choose the link in the Issue column to get more detailed resolution information about the issue if it is available.
Arithmetic Operators
Item Issue
Arithmetic operators
Issue 7775: Check the data type conversion for possible loss of accuracy (p. 196)
Arithmetic operators and date types
Issue 7773: Unable to perform an automated migration of arithmetic operations with dates (p. 196)
Arithmetic operators and mixed types
Resolution
Cast values as the intended type.
Cast values as the intended type.
Cast values as the intended type.
Built-In Services
Item
Database Mail
Service Broker
SQL Server Agent
SQL Server Backup
Issue
Issue 7900: PostgreSQL does not have functionality similar to SQL Server Database
Issue 7901: PostgreSQL does not have functionality similar to SQL Server Service
Issue 7902: PostgreSQL does not have functionality similar to SQL Server
Issue 7903: PostgreSQL does not have functionality similar to SQL Server
Resolution
Try using the Amazon Simple
Notification Service (Amazon
SNS).
Try using the Amazon Simple
Queue Service (Amazon SQS).
Try using the AWS Lambda service with Scheduled
Events.
Try using the Amazon Glacier storage service.
Built-In SQL Functions
Item
SOUNDEX
Issue
Issue 7811: PostgreSQL doesn't support the
Resolution
Create a user-defined function.
Version 1.0
188
CONTROL FLOW
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
Item
Cursors
DECLARE / DEFAULT
VALUE
GOTO
Procedures
Result sets
WAITFOR DELAY
WAITFOR TIME
Issue
Issue 7801: The table can be locked open cursor (p. 198)
Issue 7826: Check the default value for a
Issue 7628: PostgreSQL doesn't support the
GOTO option. Automatic conversion can't be performed. (p. 198)
Issue 7800: PostgreSQL doesn't support result sets in the style of MSSQL (p. 198)
Issue 7821: Automatic conversion operator WAITFOR with a variable is not supported (p. 198)
Issue 7691: PostgreSQL doesn't support
Resolution
Review your transformed code and modify it if necessary.
Check the default value for a
DateTime variable.
Revise your code to eliminate
GOTO operators, using
BEGIN...END blocks in combination with EXIT,
REPEAT, UNTIL, and WHILE operators.
Review your transformed code and modify it if necessary.
Review your transformed code and modify it if necessary.
Perform a manual conversion.
Perform a manual conversion.
CREATE
Item
Encrypted objects
Issue
Issue 7696: Unable convert object due to %s not created (p. 199)
Issue 7813: Encrypted objects (p. 199)
Resolution
Review the %s object.
Decrypt the object before conversion.
CURSORS
Item
CURSOR with option
GLOBAL
Issue
Issue 7637: PostgreSQL doesn't support
GLOBAL CURSORS. Requires manual conversion. (p. 199)
CURSOR with options
STATIC or KEYSET or DYNAMIC or
FAST_FORWARD
Issue 7639: PostgreSQL doesn't support
Version 1.0
189
Resolution
Change the global cursor to a local cursor, or revise your code so it doesn't require global cursors.
Revise your code to eliminate dynamic cursors.
Item
FAST_FORWARD option
FOR UPDATE
KEYSET option
OPTIMISTIC option
READ_ONLY option
TYPE_WARNING option
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
Issue
Issue 7803: PostgreSQL doesn't support the option FOR UPDATE, so this option is skipped (p. 199)
Issue 7704: PostgreSQL doesn't support the option OPTIMISTIC, so this option is skipped (p. 199)
Issue 7702: All PostgreSQL cursors are readonly, so this option is skipped (p. 200)
Issue 7705: PostgreSQL doesn't support the option TYPE_WARNING, so this option is skipped (p. 200)
Resolution
Use cursors without this option.
Review your transformed code and modify it if necessary.
Use cursors without this option.
Use cursors without this option.
Use cursors without this option.
Use cursors without this option.
DATA TYPES
Item
BYTEA geography geometry hierarchyid rowversion sql_variant
Issue
Issue 7818: PostgreSQL doesn't support arithmetic operations with binary data types (p. 200)
Issue 7662: PostgreSQL doesn't support this type. A manual conversion is required. (p. 200)
Issue 7664: PostgreSQL doesn't support this type. A manual conversion is required. (p. 200)
Issue 7657: PostgreSQL doesn't support this type. A manual conversion is required. (p. 200)
Resolution
Perform a manual conversion.
To store data of this type in PostgreSQL, use a
PostgreSQL-compatible type or use a composite type.
To store data of this type in PostgreSQL, use a
PostgreSQL-compatible type or use a composite type.
To store data of this type in PostgreSQL, use a
PostgreSQL-compatible type or use a composite type.
Perform a manual conversion.
Issue 7706: PostgreSQL doesn't support this type (p. 200)
Issue 7658: PostgreSQL doesn't support this type. A manual conversion is required. (p. 200)
To store data of this type in PostgreSQL, use a
PostgreSQL-compatible type or use a composite type.
Version 1.0
190
Item
table
UDT
XML
XML
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
Issue
Issue 7690: PostgreSQL doesn't support table types (p. 201)
Issue 7816: PostgreSQL doesn't support any methods for data type XML (p. 201)
Issue 7817: PostgreSQL doesn't support option [for xml path] in the SQL queries (p. 201)
Resolution
Perform a manual conversion.
Perform a manual conversion.
Perform a manual conversion.
Perform a manual conversion.
DDL
Item
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
Issue
Issue 7675: PostgreSQL doesn't support sorting options (ASC | DESC) for constraints (p. 201)
Issue 7681: PostgreSQL doesn't support clustered indexes (p. 201)
Issue 7682: PostgreSQL doesn't support the
INCLUDE option in indexes (p. 201)
Issue 7781: PostgreSQL doesn't support the
PAD_INDEX option in indexes (p. 201)
Issue 7782: PostgreSQL doesn't support the
SORT_IN_TEMPDB option in indexes (p. 202)
Issue 7783: PostgreSQL doesn't support the
IGNORE_DUP_KEY option in indexes (p. 202)
Issue 7784: PostgreSQL doesn't support the STATISTICS_NORECOMPUTE option in indexes (p. 202)
Issue 7785: PostgreSQL doesn't support the STATISTICS_INCREMENTAL option in indexes (p. 202)
Issue 7786: PostgreSQL doesn't support the
DROP_EXISTING option in indexes (p. 202)
Issue 7787: PostgreSQL doesn't support the
ONLINE option in indexes (p. 202)
Issue 7788: PostgreSQL doesn't support the ALLOW_ROW_LOCKS option in indexes (p. 202)
Resolution
Use indexes without this option.
Use nonclustered indexes.
Use index without this option.
Use index without this option.
Use index without this option.
Use index without this option.
Use index without this option.
Use index without this option.
Use index without this option.
Use index without this option.
Use index without this option.
Version 1.0
191
Item
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE TABLE
CREATE TABLE
CREATE TABLE
CREATE TABLE
Inline Function
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
Issue
Issue 7789: PostgreSQL doesn't support the ALLOW_PAGE_LOCKS option in indexes (p. 202)
Issue 7790: PostgreSQL doesn't support the
MAXDOP option in indexes (p. 202)
Issue 7791: PostgreSQL doesn't support the DATA_COMPRESSION option in indexes (p. 202)
Resolution
Use index without this option.
Use index without this option.
Use index without this option.
Issue 7679: PostgreSQL doesn't support computed columns (p. 202)
Issue 7680: PostgreSQL doesn't support global temporary tables (p. 202)
Issue 7812: Temporary table must be removed before the end of the function (p. 202)
Try using a trigger.
Use local temporary or regular tables.
Review your transformed code and modify it if necessary.
Issue 7825: The default value for a DateTime column removed (p. 203)
Issue 7776: Automatic migration of inline functions not supported (p. 203)
Review generated code and modify it if necessary.
Perform a manual conversion.
DELETE
Item
DELETE with Table
Hint Limited
TOP
Issue
WITH(Table_Hint_Limited). (p. 203)
Issue 7798: PostgreSQL doesn't support TOP option in the operator DELETE (p. 203)
Resolution
Use PostgreSQL methods for performance tuning.
Perform a manual conversion.
DML, FROM
Item
Table Hints
Issue
Issue 7823: PostgreSQL doesn't support table hints in DML statements (p. 203)
Resolution
Use PostgreSQL methods of performance tuning.
Version 1.0
192
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
EXECUTE
Item
EXECUTE a character string
Execute a passthrough command against a linked server
EXECUTE with execute options
[RECOMPILE]
Issue
Issue 7695: PostgreSQL doesn't support the execution of a procedure as a variable (p. 204)
Issue 7672: Automatic conversion of this command is not supported (p. 204)
Issue 7645: PostgreSQL doesn't support executing a pass-through command on a linked server (p. 204)
Issue 7640: The EXECUTE with RECOMPILE option is ignored (p. 204)
EXECUTE with execute options
Issue 7643: The EXECUTE with RESULT
SETS <result set definition> option is
[RESULT SETS
(<result_sets_definition>)]
EXECUTE with execute options
[RESULT SETS NONE]
EXECUTE with execute options
[RESULT SETS
UNDEFINED]
Issue 7642: The EXECUTE with RESULT SETS
NONE option is ignored (p. 204)
Issue 7641: The EXECUTE with RESULT SETS
UNDEFINED option is ignored (p. 204)
Resolution
Perform a manual conversion using dynamic SQL.
Perform a manual conversion.
Use other methods to execute statements on a remote server.
Use EXECUTE command without this option.
Use EXECUTE command without this option.
Use EXECUTE command without this option.
Use EXECUTE command without this option.
INSERT
Item
EXECUTE
TOP
Issue
Issue 7819: PostgreSQL doesn't support
INSERT...EXECUTE statements (p. 204)
Issue 7799: PostgreSQL doesn't support TOP option in the operator INSERT (p. 205)
Resolution
Perform a manual conversion.
Perform a manual conversion.
Operators
Item
Bitwise Operators
Comparison
Operators
Comparison
Operators
Issue
Issue 7804: PostgreSQL doesn't support operator [Bitwise exclusive OR] (p. 205)
Issue 7805: PostgreSQL doesn't support operator [Not less than] (p. 205)
Issue 7806: PostgreSQL doesn't support operator [Not greater than] (p. 205)
Version 1.0
193
Resolution
Perform a manual conversion.
Perform a manual conversion.
Perform a manual conversion.
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
Parser Error
Item
Parser Error
SEQUENCE
Item
Specific data type
Issue
Issue 7663: Unable to resolve the object (p. 206)
SELECT
Item
GROUP BY CUBE
GROUP BY CUBE
Group By Grouping
Sets
ORDER BY Specifying a collation search condition search condition search condition
TOP WITH TIES
Issue
Issue 7655: PostgreSQL doesn't support the option GROUP BY GROUPING
SETS. Automatic conversion can't be performed. (p. 206)
Issue 7687: PostgreSQL doesn't support the
Issue 7688: PostgreSQL doesn't support the
Issue 7795: PostgreSQL is case sensitive.
Check the string comparison. (p. 206)
Issue 7605: PostgreSQL doesn't support the
Resolution
Try creating a stored procedure to replace the query.
Try creating a stored procedure to replace the query.
Try creating a stored procedure to replace the query.
You must use the COLLATION settings that were assigned when the database was created.
Perform a manual conversion.
Perform a manual conversion.
Check the string comparison.
Perform a manual conversion.
Issue
Issue 7793: PostgreSQL doesn't support changing data type in sequences (p. 207)
Resolution
Verify if object <object name> is present in the database.
If it isn't, check the object name or add the object. If the object is present, transform the code manually.
Resolution
Review your transformed code and modify it if necessary.
Version 1.0
194
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
SYNONYMS
Item
CREATE
TRIGGERS
Item
Triggers
Issue
Issue 7792: PostgreSQL doesn't support synonyms (p. 207)
Issue
Issue 7809: In PostgreSQL there are no analogues of the tables 'inserted' and
Resolution
Replace a synonym with original database object. If original object is table or view you can try to create a view in one database that relies on a table or view in another database.
SYS objects
Item
SYS objects
Issue
Issue 7904: Unable to convert system object
Resolution
Perform a manual conversion.
TRANSACTION
Item
Transaction
Issue
Issue 7807: Transactions in functions
PostgreSQL doesn't support (p. 207)
Resolution
Perform a manual conversion.
Resolution
Perform a manual conversion.
Unknown
Item
Unknown Clause
Unparsed SQL
Issue
Issue 7627: This syntactic element conversion is not supported yet (p. 209)
Issue 7674: Automatic conversion of
<clause name> clause of <statement name> statement is not supported (p. 209)
Issue 7808: Unparsed SQL (p. 209)
Resolution
Perform a manual conversion.
Perform a manual conversion.
Perform a manual conversion.
Version 1.0
195
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
UPDATE
Item
TOP
UPDATE
Variable assignment
Issue
Issue 7796: PostgreSQL doesn't support TOP option in the operator UPDATE (p. 209)
Issue 7829: Unable to convert variable assignment by UPDATE statement (p. 211)
Resolution
Perform a manual conversion.
This case requires manual conversion.
Perform a manual conversion.
User Types
Item
User-Defined Data
Types
Issue
Issue 7794: PostgreSQL doesn't support userdefined data types (p. 211)
Resolution
Perform a manual conversion.
Conversion Issues with Arithmetic Operators
Issue 7775: Check the data type conversion for possible loss of accuracy
To avoid loss of accuracy for types in arithmetic operations, cast values as the intended type, as in the example following.
BEGIN
SELECT
5.1E+1::REAL
INTO lBinaryFloat;
SELECT
- 5.2E-1::DOUBLE PRECISION
INTO lBinaryDouble;
var1 := (var_varchar1||var_varchar2)::INTEGER;
var2 := (var_varchar1||var_varchar3)::NUMERIC;
var3 := var_varchar1::NUMERIC + var_numeric2;
var4 := var_timestamp2 + (var_numeric1::NUMERIC || 'day')::INTERVAL;
END;
Issue 7773: Unable to perform an automated migration of arithmetic operations with dates
The Schema Conversion Tool cannot automatically migrate arithmetic operations that use date types.
Cast values as the intended type, as in the example following.
BEGIN
var3 := var_varchar1::NUMERIC + var_numeric2;
Version 1.0
196
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
var4 := var_timestamp2 + (var_numeric1::NUMERIC || 'day')::INTERVAL;
END;
Issue 7774: Unable to perform an automated migration of the arithmetic operations with mixed types of operands
The Schema Conversion Tool cannot automatically migrate arithmetic operations that mix types. For example, multiplying a variable of type FLOAT with a variable of type INT. Cast values as the intended type before performing any arithmetic operations, as in the example following.
BEGIN
var1 := (var_varchar1||var_varchar2)::INTEGER;
var2 := (var_varchar1||var_varchar3)::NUMERIC;
END;
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with BUILT-IN SERVICES
Issue 7900: PostgreSQL does not have functionality similar to SQL Server
Database Mail
Try using the Amazon Simple Queue Service (Amazon SQS). For more information, see What is Amazon
Simple Queue Service?
Issue 7901: PostgreSQL does not have functionality similar to SQL Server
Service Broker
Try using the Amazon Simple Queue Service (SQS). For more information, see What is Amazon Simple
Queue Service?
in the Amazon SQS documentation.
Issue 7902: PostgreSQL does not have functionality similar to SQL Server Agent
Try using the AWS Lambda service with Scheduled Events. For more information, see What Is AWS
Lambda?
in the AWS Lambda Developer Guide.
Issue 7903: PostgreSQL does not have functionality similar to SQL Server
Backup
Try using the Amazon Glacier storage service. For more information, see What Is Amazon Glacier?
in the
Amazon Glacier Developer Guide.
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Version 1.0
197
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
Conversion Issues with BUILT-IN SQL FUNCTIONS
Issue 7811: PostgreSQL doesn't support the SOUNDEX function
Create a user-defined function.
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with CONTROL FLOW
Issue 7800: PostgreSQL doesn't support result sets in the style of MSSQL
Review your transformed code and modify it if necessary.
Issue 7801: The table can be locked open cursor
In Microsoft SQL Server, a local temporary table created in a stored procedure is dropped automatically when the stored procedure completes. Temporary tables in PostgreSQL are automatically dropped at the end of a session. The conversion uses the DROP TABLE IF EXISTS statement to emulate this behavior and remove the temporary table before the end of the function that created it. In some cases though, this statement might fail because the temporary table is locked due to an open cursor. In this case, the DROP
TABLE statement must be commented out. Review your transformed code and modify it if necessary.
Issue 7802: A table that is created within the procedure, must be deleted before the end of the procedure
Review your transformed code and modify it if necessary.
Issue 7826: Check the default value for a DateTime variable
Check the default value for a DateTime variable.
Issue 7628: PostgreSQL doesn't support the GOTO option. Automatic conversion can't be performed.
Revise your code to eliminate GOTO operators, using BEGIN...END blocks in combination with EXIT,
REPEAT, UNTIL, and WHILE operators.
Issue 7821: Automatic conversion operator WAITFOR with a variable is not supported
You must perform a manual conversion in cases where you have a WAITFOR DELAY statement that uses a variable, for example
WAITFOR DELAY @time;
, instead of a literal value, for example
WAITFOR DELAY
'00:00:05';
.
Issue 7691: PostgreSQL doesn't support WAITFOR TIME feature
Perform a manual conversion.
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
Version 1.0
198
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with CREATE
Issue 7696: Unable convert object due to %s not created
Review the <object name> object.
Issue 7813: Encrypted objects
Decrypt the object before conversion.
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with CURSORS
Issue 7637: PostgreSQL doesn't support GLOBAL CURSORS. Requires manual conversion.
Change the global cursor to a local cursor, or revise your code so it doesn't require global cursors.
Issue 7639: PostgreSQL doesn't support DYNAMIC cursors
Revise your code to remove the DYNAMIC option from any cursors.
Issue 7701: Setting this option corresponds to the typical behavior of cursors in
PostgreSQL, so this option is skipped
The FAST_FORWARD option is skipped during conversion, because PostgreSQL cursors provide the same behavior as the FAST_FORWARD option by default. Review your transformed code and modify it if necessary.
Issue 7803: PostgreSQL doesn't support the option FOR UPDATE, so this option is skipped
The FOR_UPDATE option is skipped during conversion because PostgreSQL doesn't support it. Review your transformed code and modify it if necessary.
Issue 7700: The membership and order of rows never changes for cursors in
PostgreSQL, so this option is skipped
Use cursors without this option.
Issue 7704: PostgreSQL doesn't support the option OPTIMISTIC, so this option is skipped
Use cursors without this option.
Version 1.0
199
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
Issue 7702: All PostgreSQL cursors are read-only, so this option is skipped
Use cursors without this option.
Issue 7705: PostgreSQL doesn't support the option TYPE_WARNING, so this option is skipped
Use cursors without this option.
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with DATA TYPES
Issue 7818: PostgreSQL doesn't support arithmetic operations with binary data types
Perform a manual conversion.
Issue 7662: PostgreSQL doesn't support this type. A manual conversion is required.
PostgreSQL doesn't support the geography data type. To store data of this type in PostgreSQL, use a
PostgreSQL-compatible type or use a composite type.
Issue 7664: PostgreSQL doesn't support this type. A manual conversion is required.
PostgreSQL doesn't support the geometry data type. To store data of this type in PostgreSQL, use a
PostgreSQL-compatible type or use a composite type.
Issue 7657: PostgreSQL doesn't support this type. A manual conversion is required.
PostgreSQL doesn't support the hierarchyid data type. To store data of this type in PostgreSQL, use a
PostgreSQL-compatible type or use a composite type.
Issue 7706: PostgreSQL doesn't support this type
PostgreSQL doesn't support the rowversion data type. To store data of this type in PostgreSQL, use a
PostgreSQL-compatible type.
Issue 7658: PostgreSQL doesn't support this type. A manual conversion is required.
PostgreSQL doesn't support the sql_variant data type. To store data of this type in PostgreSQL, use a
PostgreSQL-compatible type or use a composite type.
Issue 7659: The scope table-variables and temporary tables is different. You must apply manual conversion, if you are using recursion.
Perform a manual conversion.
Version 1.0
200
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
Issue 7690: PostgreSQL doesn't support table types
PostgreSQL doesn’t support table parameters in CREATE PROCEDURE statements, as in the example following.
CREATE TYPE Employee2Client AS TABLE(
EmployeeID int,
EmployeeName varchar(160),
ClientID int,
ClientName varchar(160)
) go
CREATE PROCEDURE [dbo].[PROC_CREATE_PROC_005]
@p_E2C Employee2Client READONLY
AS
BEGIN
select * from @p_E2C where upper(ClientName) like concat('%', upper('bank'), '%') ;
Convert to temporary tables or row variables (for example, name table_name%ROWTYPE;
).
Issue 7816: PostgreSQL doesn't support any methods for data type XML
Microsoft SQL Server provides methods for the xml data type that you can use to read and manipulate
XML data, but PostgreSQL's xml data type does not offer parallel functionality. Perform a manual conversion to use PostgreSQL XML handling functionality instead.
Issue 7817: PostgreSQL doesn't support option [for xml path] in the SQL queries
PostgreSQL doesn't support using the FOR XML clause in PATH mode for DML statements. Perform a manual conversion to use PostgreSQL XML handling functionality instead.
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with DDL
Issue 7675: PostgreSQL doesn't support sorting options (ASC | DESC) for constraints
Remove these options from indexes and constraints.
Issue 7681: PostgreSQL doesn't support clustered indexes
Use nonclustered indexes.
Issue 7682: PostgreSQL doesn't support the INCLUDE option in indexes
Use the index without this option.
Issue 7781: PostgreSQL doesn't support the PAD_INDEX option in indexes
Use the index without this option.
Version 1.0
201
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
Issue 7782: PostgreSQL doesn't support the SORT_IN_TEMPDB option in indexes
Use the index without this option.
Issue 7783: PostgreSQL doesn't support the IGNORE_DUP_KEY option in indexes
Use the index without this option.
Issue 7784: PostgreSQL doesn't support the STATISTICS_NORECOMPUTE option in indexes
Use the index without this option.
Issue 7785: PostgreSQL doesn't support the STATISTICS_INCREMENTAL option in indexes
Use the index without this option.
Issue 7786: PostgreSQL doesn't support the DROP_EXISTING option in indexes
Use the index without this option.
Issue 7787: PostgreSQL doesn't support the ONLINE option in indexes
Use the index without this option.
Issue 7788: PostgreSQL doesn't support the ALLOW_ROW_LOCKS option in indexes
Use index without this option.
Issue 7789: PostgreSQL doesn't support the ALLOW_PAGE_LOCKS option in indexes
Use index without this option.
Issue 7790: PostgreSQL doesn't support the MAXDOP option in indexes
Use index without this option.
Issue 7791: PostgreSQL doesn't support the DATA_COMPRESSION option in indexes
Use index without this option.
Issue 7679: PostgreSQL doesn't support computed columns
Try using a trigger instead.
Issue 7680: PostgreSQL doesn't support global temporary tables
Use local temporary or regular tables.
Issue 7812: Temporary table must be removed before the end of the function
Review your transformed code and modify it if necessary.
Version 1.0
202
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
Issue 7825: The default value for a DateTime column removed
Review generated code and modify it if necessary.
Issue 7776: Automatic migration of inline functions not supported
Perform a manual conversion.
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with DELETE
Issue 7623: PostgreSQL doesn't support hints in DELETE statements. The conversion skips options in the format WITH(Table_Hint_Limited).
PostgreSQL doesn't support usings hints (for example, WITH FORCESCAN) to override the default behavior of the query optimizer when executing Data Manipulation Language (DML) statements. Use
PostgreSQL methods for performance tuning instead.
Issue 7798: PostgreSQL doesn't support TOP option in the operator DELETE
Perform a manual conversion for any DELETE statements that contain a TOP argument, as in the example following.
delete top (<expression >)[PERCENT] from <table-name>;
In PostgreSQL, you can use a subquery in the WHERE clause to identify the rows you want to delete.
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with DML, FROM
Issue 7823: PostgreSQL doesn't support table hints in DML statements
PostgreSQL doesn't support usings hints (for example, WITH FORCESCAN) to override the default behavior of the query optimizer when executing Data Manipulation Language (DML) statements. Use
PostgreSQL methods of performance tuning instead.
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Version 1.0
203
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
Conversion Issues with EXECUTE
Issue 7695: PostgreSQL doesn't support the execution of a procedure as a variable
Perform a manual conversion (one possibility is to use dynamic SQL). This issue occurs when you pass in the name of a procedure to an EXECUTE statement by using a variable, as in the example following.
ALTER PROCEDURE [dbo].[PROC_EXECUTE_009]
AS
SET NOCOUNT ON
BEGIN
declare @v_ID int;
declare @v_ProcName varchar(20) = '[dbo].[PROC_DML_015]';
exec @v_ProcName
@v_ID output
Issue 7672: Automatic conversion of this command is not supported
This issue is often caused by an EXECUTE statement that executes a string or variable, for example
EXEC('select * from Customer');
or
EXEC(@variable);
. Convert each of these statements to a pair of
PREPARE and EXECUTE statements in PostgreSQL.
Issue 7645: PostgreSQL doesn't support executing a pass-through command on a linked server
Use other methods to execute statements on a remote server.
Issue 7640: The EXECUTE with RECOMPILE option is ignored
Use the EXECUTE command without this option.
Issue 7643: The EXECUTE with RESULT SETS <result set definition> option is ignored
Use the EXECUTE command without this option.
Issue 7642: The EXECUTE with RESULT SETS NONE option is ignored
Use the EXECUTE command without this option.
Issue 7641: The EXECUTE with RESULT SETS UNDEFINED option is ignored
Use the EXECUTE command without this option.
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with INSERT
Issue 7819: PostgreSQL doesn't support INSERT...EXECUTE statements
Perform a manual conversion. PostgreSQL doesn't support using EXECUTE within an INSERT statement to insert the results of a stored procedure into a table.
Version 1.0
204
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
Issue 7799: PostgreSQL doesn't support TOP option in the operator INSERT
Perform a manual conversion for any INSERT statements that contain a TOP argument, as in the example following.
insert TOP(2) percent into Customer(
id
,sname
,name
,typeid
,taxcode
,stateid
,opendate
,closedate
)select
id+1000
,name
,name
,4
,61+id
,1
,getdate()
,null from
employees e where
name not in(select name from Customer)
and exists(select 1 from Employees where ManagerId = e.id)
In PostgreSQL, you can use the row_number() window function in the FROM clause or a subquery in the
WHERE clause of the SELECT statement you use to select the data to be inserted to identify the rows you want to insert.
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Operators
Issue 7804: PostgreSQL doesn't support operator [Bitwise exclusive OR]
Perform a manual conversion.
Issue 7805: PostgreSQL doesn't support operator [Not less than]
Perform a manual conversion.
Issue 7806: PostgreSQL doesn't support operator [Not greater than]
Perform a manual conversion.
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Version 1.0
205
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
Conversion Issues with Parser Error
Issue 7663: Unable to resolve the object
Verify if object <object name> is present in the database. If it isn't, check the object name or add the object. If the object is present, transform the code manually.
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with SELECT
Issue 7653: PostgreSQL doesn't support the option GROUP BY ROLLUP.
Automatic conversion can't be performed.
Try creating a stored procedure to replace the query.
Issue 7654: PostgreSQL doesn't support the option GROUP BY CUBE. Automatic conversion can't be performed.
Try creating a stored procedure to replace the query.
Issue 7655: PostgreSQL doesn't support the option GROUP BY GROUPING SETS.
Automatic conversion can't be performed.
Try creating a stored procedure to replace the query.
Issue 7646: PostgreSQL doesn't support the COLLATE option in the ORDER BY clause. Automatic conversion can't be performed.
You must use the collation settings that were assigned when the database was created.
Issue 7687: PostgreSQL doesn't support the CONTAINS predicate
Perform a manual conversion by re-writing the SELECT statement to use PostgreSQL full-text search functionality instead. For more information about full-text search in PostgreSQL, see Tables and Indexes in the PostgreSQL documentation.
Issue 7688: PostgreSQL doesn't support the FREETEXT predicate
Perform a manual conversion by re-writing the SELECT statement to use PostgreSQL full-text search functionality instead. For more information about full-text search in PostgreSQL, see Tables and Indexes in the PostgreSQL documentation.
Issue 7795: PostgreSQL is case sensitive. Check the string comparison.
Check string comparisons in the WHERE clauses of statements, for example
WHERE [Name] LIKE
'%BLOCKED%';
. All strings used in comparisons must be lowercase.
Issue 7605: PostgreSQL doesn't support the WITH TIES option
Perform a manual conversion of any TOP statements that use the WITH TIES clause. You can use the rank() window function in PostgreSQL to provide similar results.
Version 1.0
206
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with SEQUENCE
Issue 7793: PostgreSQL doesn't support changing data type in sequences
PostgreSQL doesn't support setting a sequence's data type by using the AS clause of the CREATE
SEQUENCE statement. Review your transformed code and modify it if necessary.
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with SYNONYMS
Issue 7792: PostgreSQL doesn't support synonyms
PostgreSQL doesn't support the CREATE SYNONYM statement. To convert, replace the synonym in any statement with the original database object. If the original object is a table or view, you can try to create a view in one database that relies on a table or view in another database.
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with SYS objects
Issue 7904: Unable to convert system object <object name>
Perform a manual conversion.
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with TRANSACTION
Issue 7807: Transactions in functions PostgreSQL doesn't support
Perform a manual conversion to correct this issue.
Version 1.0
207
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
PostgreSQL supports local transactions within a given client session. You must manually convert
Microsoft SQL Server transactions to use the PostgreSQL transaction management statements instead.
PostgreSQL doesn't support named or distributed transactions, marking transactions, or transaction management within functions. For more information about using transactions in PostgreSQL, see
TRANSACTIONS in the PostgreSQL documentation.
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with TRIGGERS
Issue 7809: In PostgreSQL there are no analogues of the tables 'inserted' and
'deleted'
PostgreSQL doesn't support the inserted or deleted virtual tables. To manually convert a trigger that uses these tables from Microsoft SQL Server to PostgreSQL, perform the following steps:
1. Create a trigger function. The trigger function must be declared as a function taking no arguments and returning type trigger. The returned value must be NEW, OLD or NULL, depending on the type of a trigger. The function’s body must be PostgreSQL-supported SQL to replace the body of the
Microsoft SQL Server trigger without using the virtual tables. The name of the function should be formed as
schema_name.fn_<%trigger_name%>()
.
2. Create a trigger with CREATE TRIGGER that executes the trigger function.
For example, consider the following Microsoft SQL Server trigger.
CREATE TRIGGER [dbo].[tr_customerStateExt_aiu]
ON [dbo].[CustomerStateExt]
AFTER INSERT, UPDATE
AS
BEGIN
IF EXISTS (SELECT *
FROM inserted
WHERE LEN(Name) < 5)
BEGIN
RAISERROR ('The name must be longer than five characters.', 16, 1);
ROLLBACK TRANSACTION;
RETURN
END;
END
GO
Using the approach described, this trigger is converted into the following PostgreSQL trigger.
CREATE OR REPLACE FUNCTION mydb_dbo.fn_tr_customerStateExt_aiu()
RETURNS trigger
AS
$BODY$
BEGIN
<SQL to write around use of the inserted and deleted virtual tables>
END;
$BODY$
LANGUAGE plpgsql;
Version 1.0
208
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
CREATE TRIGGER tr_customerStateExt_aiu
AFTER INSERT OR UPDATE
ON mydb_dbo.CustomerStateExt
FOR EACH STATEMENT
EXECUTE PROCEDURE mydb_dbo.fn_tr_customerStateExt_aiu();
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Unknown
Issue 7627: This syntactic element conversion is not supported yet
Perform a manual conversion.
Issue 7674: Automatic conversion of <clause name> clause of <statement name> statement is not supported
Perform a manual conversion to correct this issue.
A common cause of this issue is SET statements in Microsoft SQL Server that affect current session handling (a complete list of these SET statements is available at SET Statements (Transact-SQL) ).
These statements are not supported in PostgreSQL, so you need to perform a manual conversion to a
PostgreSQL SET statement. For more information about using a SET statement in PostgreSQL, see SET in the PostgreSQL documentation.
Issue 7808: Unparsed SQL
Perform a manual conversion.
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with UPDATE
Issue 7796: PostgreSQL doesn't support TOP option in the operator UPDATE
Perform a manual conversion for any UPDATE statements that contain a TOP argument, as in the example following.
update top(10)
Account set
AccountBalance = AccountBalance - 1 where
AccountBalance > 15723
Version 1.0
209
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
; or: update top(5) percent
Account set
AccountBalance = AccountBalance - 1 where
AccountBalance > 15723
;
In PostgreSQL, you can use the row_number() window function in the FROM clause or a subquery in the
WHERE clause of the UPDATE statement to identify the rows you want to modify.
Issue 7797: PostgreSQL doesn't have analog for option "OUTPUT" with using the implicit table "deleted" in the operator for UPDATE
Perform a manual conversion for any UPDATE statements that uses the OUTPUT clause and references the deleted virtual table, as in the example following.
update Customer set
name = 'Mister ' + name output
deleted.id,
deleted.name,
inserted.id,
inserted.name
where
TypeID = 4
In PostgreSQL, use a subquery in the RETURNING clause to return the information about the deleted table. This approach requires the table to have a primary key field.
update mydb_dbo.Customer c set
name = 'Mister ' || name where
TypeID = 4 returning
(select id from mydb_dbo.Customer where id = c.id)
,(select name from mydb_dbo.Customer where id = c.id)
,id
,name
If the primary key is composed of multiple fields, you must reference all of those fields in the subquery.
For example, take the following statement in SQL Server where id1 and id2 are the primary key fields for the TestMultiPK table.
UPDATE [TestMultiPK]
SET [Description] = 'Test' output
deleted.id1,
deleted.id2,
deleted.Description,
inserted.id1,
inserted.id2,
inserted.Description where ID = 0
Version 1.0
210
AWS Schema Conversion Tool User Guide
Microsoft SQL Server to PostgreSQL
Conversion Issue Reference
The PostgreSQL conversion is as follows.
UPDATE [TestMultiPK] t
SET [Description] = 'Test'
WHERE ID = 0 returning
select (id1 from TestMultiPK where id1 = t.id1 and id2 = t.id2)
, select (id2 from TestMultiPK where id1 = t.id1 and id2 = t.id2)
, select (Description from TestMultiPK where id1 = t.id1 and id2 = t.id2)
, id1
, id2
, Description
Issue 7829: Unable to convert variable assignment by UPDATE statement
Perform a manual conversion. This issue occurs when you use an UPDATE statement to change the value of a variable, as in the example following.
CREATE PROCEDURE [dbo].[PROC_DML_UPDATE_FROM_3]
AS
BEGIN
DECLARE @AccountBalance FLOAT = 400;
UPDATE bank
SET @AccountBalance = 500
FROM bank
WHERE id = 50005;
END
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with User Types
Issue 7794: PostgreSQL doesn't support user-defined data types
To correct this issue, perform a manual conversion of each sp_ addtype or CREATE TYPE statement in
Microsoft SQL Server to a CREATE TYPE statement in PostgreSQL. For more information about creating a user-defined data type in PostgreSQL, see CREATE TYPE in the PostgreSQL documentation.
Related Topics
•
Microsoft SQL Server to PostgreSQL Conversion Issue Reference (p. 188)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Related Topics
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Version 1.0
211
AWS Schema Conversion Tool User Guide
MySQL to PostgreSQL Supported Schema Conversion
MySQL to PostgreSQL Supported Schema
Conversion
The following sections list the schema elements from a MySQL database and whether they are supported for automatic conversion to PostgreSQL using the AWS Schema Conversion Tool.
DDL
Alter Statements
ALTER TABLE
Clause
ADD CONSTRAINT
ADD INDEX
Automatically
Converted
Details
Yes
Yes
Create Statements
CREATE INDEX
Clause
INDEX
UNIQUE index
Automatically
Converted
Details
Yes
Yes
CREATE PROCEDURE
Clause Automatically
Converted
Details
PARAMETERS: IN, OUT,
INOUT
With any output parameters
Yes
Yes
Without output parameters Yes
CREATE TABLE
Clause
Regular tables
Temporary tables
Automatically
Converted
Details
Yes
Yes
Version 1.0
212
AWS Schema Conversion Tool User Guide
DML
CREATE TRIGGER
Clause
FOR EACH ROW Triggers
Trigger event (Insert /
Update / Delete )
Trigger time (Before /
After)
Automatically
Converted
Details
Yes
Yes
Yes
CREATE VIEW
Clause Automatically
Converted
Details
With ALGORITHM OPTION Partial
Issue 8824: ALGORITHM option is not supported (p. 241)
With CHECK OPTION Yes
Naming Objects
Clause
Schemas
Tables, Columns
Automatically
Converted
Details
Yes
Yes
DML
Clauses
FROM
Clause
CROSS JOIN
INNER JOIN join_condition: ...ON
conditional_expr join_condition: … USING
(column_list)
LEFT JOIN
LEFT OUTER JOIN
Automatically
Converted
Details
Yes
Yes
Yes
Yes
Yes
Yes
Version 1.0
213
AWS Schema Conversion Tool User Guide
DML
Clause
NATURAL LEFT JOIN
NATURAL LEFT OUTER
JOIN
NATURAL RIGHT JOIN
NATURAL RIGHT OUTER
JOIN
RIGHT JOIN
RIGHT OUTER JOIN
STRAIGHT_JOIN
Subqueries in the FROM
Clause tables_list
Yes
Yes
Yes
Yes
Yes
Automatically
Converted
Details
Yes
Yes
Yes
Yes
Statements
DELETE
Clause
IGNORE
LIMIT
LOW_PRIORITY
Multiple-Table Syntax
Multiple-Table Syntax with
USING
ORDER BY
QUICK
Automatically
Converted
Details
Partial
Issue 8831: PostgreSQL doesn't have an option similar to
IGNORE for DML statements (p. 237)
Yes
Partial
Partial
Partial
Issue 8830: PostgreSQL doesn't have an option similar to
LOW_PRIORITY for DML statements (p. 237)
Issue 8834: PostgreSQL can't delete from several tables at the same time (p. 238)
Issue 8834: PostgreSQL can't delete from several tables at the same time (p. 238)
Yes
Partial
Issue 8832: PostgreSQL doesn't have an option similar to
QUICK for DML statements (p. 237)
INSERT
Clause
IGNORE
Automatically
Converted
Details
Partial
Issue 8831: PostgreSQL doesn't have an option similar to
IGNORE for DML statements (p. 237)
Version 1.0
214
AWS Schema Conversion Tool User Guide
DML
Clause
LOW_PRIORITY | DELAYED |
HIGH_PRIORITY
ON DUPLICATE KEY
UPDATE
SELECT-statement for insert
SET col1=expr1,..
VALUES(,…,)|VALUE(,…,)
Automatically
Converted
Details
Partial
No
Issue 8830: PostgreSQL doesn't have an option similar to
LOW_PRIORITY for DML statements (p. 237)
Issue 8829: PostgreSQL doesn't have an analog of clause
ON DUPLICATE KEY UPDATE (p. 237)
Yes
Yes
Yes
SELECT
Clause
DISTINCT
GROUP BY ASC, DESC
GROUP BY col_name,…
GROUP BY expression
GROUP BY mixed options
GROUP BY position,…
GROUP BY WITH ROLLUP
HAVING
HIGH_PRIORITY
LIMIT offset, row_count
LIMIT row_count OFFSET offset
MAX_STATEMENT_TIME =
N
ORDER BY col_name,…
ORDER BY expression
ORDER BY mixed options
ORDER BY position,…
SQL_BIG_RESULT
Partial
Yes
Yes
Yes
Yes
Partial
Yes
Yes
Yes
Automatically
Converted
Details
Yes
Yes
Yes
No
Issue 8653: PostgreSQL doesn't support the option
Yes
Partial
Issue 8836: PostgreSQL doesn't have an option similar to
%s for DML statements (p. 238)
Yes
Yes
Issue 8836: PostgreSQL doesn't have an option similar to
%s for DML statements (p. 238)
Issue 8836: PostgreSQL doesn't have an option similar to
%s for DML statements (p. 238)
Version 1.0
215
AWS Schema Conversion Tool User Guide
DML
Clause
SQL_BUFFER_RESULT
SQL_CACHE
Automatically
Converted
Details
Partial
Partial
Issue 8836: PostgreSQL doesn't have an option similar to
%s for DML statements (p. 238)
Issue 8836: PostgreSQL doesn't have an option similar to
%s for DML statements (p. 238)
SQL_CALC_FOUND_ROWS Partial
SQL_NO_CACHE
SQL_SMALL_RESULT
Partial
Partial
Issue 8836: PostgreSQL doesn't have an option similar to
%s for DML statements (p. 238)
Issue 8836: PostgreSQL doesn't have an option similar to
%s for DML statements (p. 238)
Issue 8836: PostgreSQL doesn't have an option similar to
%s for DML statements (p. 238)
STRAIGHT_JOIN Partial
Issue 8836: PostgreSQL doesn't have an option similar to
%s for DML statements (p. 238)
Select all columns (using * and aliases)
Yes
Select all columns (using *) Yes
Select subset of the columns
Yes
Select with calculations Yes
Select with column heading Yes
Select with constants Yes
Subquery as scalar operand Yes
UPDATE
Clause
DEFAULT VALUES
IGNORE
LIMIT
LOW_PRIORITY
Multiple-table syntax
ORDER BY
Automatically
Converted
Details
Yes
Partial
Issue 8831: PostgreSQL doesn't have an option similar to
IGNORE for DML statements (p. 237)
Yes
Partial
Issue 8830: PostgreSQL doesn't have an option similar to
LOW_PRIORITY for DML statements (p. 237)
Yes
Yes
Version 1.0
216
AWS Schema Conversion Tool User Guide
Functions
Functions
Aggregate
Clause
AVG()
BIT_AND()
BIT_OR()
BIT_XOR()
COUNT()
COUNT(DISTINCT)
GROUP_CONCAT()
MAX()
MIN()
STD()
STDDEV()
STDDEV_POP()
STDDEV_SAMP()
SUM()
VAR_POP()
VAR_SAMP()
VARIANCE()
Bit
Clause
BIT_COUNT()
Control Flow
Clause
CASE
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Yes
Automatically
Converted
Details
Yes
Yes
Yes
Automatically
Converted
Details
Yes
Automatically
Converted
Details
Yes
Version 1.0
217
Clause
IF()
IFNULL()
NULLIF()
Conversion
Clause
BINARY
CAST()
CONVERT()
Date and Time
Clause
ADDDATE()
ADDTIME()
CONVERT_TZ()
CURDATE()
AWS Schema Conversion Tool User Guide
Functions
Automatically
Converted
Details
Yes
Yes
Yes
Automatically
Converted
Details
Yes
Yes
Yes
Automatically
Converted
Details
Yes
Yes
Yes
Yes
CURTIME()
DATE()
DATE_ADD()
DATE_FORMAT()
DATE_SUB()
DATEDIFF()
DAY()
DAYNAME()
DAYOFMONTH()
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Version 1.0
218
MAKEDATE()
MAKETIME()
MICROSECOND()
MINUTE()
MONTH()
MONTHNAME()
NOW()
PERIOD_ADD()
PERIOD_DIFF()
QUARTER()
SEC_TO_TIME()
SECOND()
STR_TO_DATE()
SUBDATE()
SUBTIME()
SYSDATE()
TIME()
TIME_FORMAT()
TIME_TO_SEC()
TIMEDIFF()
AWS Schema Conversion Tool User Guide
Functions
Clause
DAYOFWEEK()
DAYOFYEAR()
EXTRACT()
FROM_DAYS()
FROM_UNIXTIME()
GET_FORMAT()
HOUR()
LAST_DAY
LOCALTIME(), LOCALTIME
Yes
Yes
Yes
Yes
Yes
Automatically
Converted
Details
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Version 1.0
219
AWS Schema Conversion Tool User Guide
Functions
Clause
TIMESTAMP()
TIMESTAMPADD()
TIMESTAMPDIFF()
TO_DAYS()
TO_SECONDS()
UNIX_TIMESTAMP()
UTC_DATE()
UTC_TIME()
UTC_TIMESTAMP()
WEEK()
WEEKDAY()
WEEKOFYEAR()
YEAR()
YEARWEEK()
Yes
Yes
No
Yes
Yes
Yes
Yes
Yes
Yes
No
Automatically
Converted
Details
Yes
Yes
Yes
Yes
Encryption and Compression
Clause Automatically
Converted
Details
AES_DECRYPT()
AES_ENCRYPT()
COMPRESS()
DECODE() No
DES_DECRYPT() (deprecated
5.7.6)
No
No
No
No
DES_ENCRYPT() (deprecated
5.7.6)
No
ENCODE()
ENCRYPT() (deprecated
5.7.6)
No
No
MD5()
OLD_PASSWORD()
No
No
Version 1.0
220
AWS Schema Conversion Tool User Guide
Functions
Clause
PASSWORD() (deprecated
5.7.6)
RANDOM_BYTES()
SHA1(), SHA()
SHA2()
UNCOMPRESS()
No
UNCOMPRESSED_LENGTH() No
No
No
No
Automatically
Converted
Details
No
Information
Clause
BENCHMARK()
CHARSET()
COERCIBILITY()
COLLATION()
CONNECTION_ID()
DATABASE()
FOUND_ROWS()
LAST_INSERT_ID()
ROW_COUNT()
SCHEMA()
SESSION_USER()
SYSTEM_USER()
USER()
VERSION()
No
No
No
No
No
No
No
No
No
No
No
No
Automatically
Converted
Details
No
No
Version 1.0
221
AWS Schema Conversion Tool User Guide
Functions
Mathematical
Clause
ABS()
ACOS()
ASIN()
ATAN()
ATAN2()
CEIL()
CEILING()
CONV()
POW()
POWER()
RADIANS()
RAND()
ROUND(X)
SIGN()
SIN()
SQRT()
COS()
COT()
CRC32()
DEGREES()
EXP()
FLOOR()
LN()
LOG()
LOG10()
LOG2()
MOD()
PI()
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Automatically
Converted
Details
Yes
Yes
Yes
Issue 8811: PostgreSQL doesn't support the %s function (p. 234)
Version 1.0
222
Clause
TAN()
TRUNCATE()
String
Clause
ASCII()
BIN()
BIT_LENGTH()
CHAR()
CHAR_LENGTH()
CHARACTER_LENGTH()
CONCAT()
CONCAT_WS()
ELT()
EXPORT_SET()
FIELD()
FIND_IN_SET()
FORMAT()
FROM_BASE64()
HEX()
INSERT()
INSTR()
LCASE()
LEFT()
LENGTH()
LIKE
LOAD_FILE()
LOCATE()
AWS Schema Conversion Tool User Guide
Functions
Automatically
Converted
Details
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
No
Yes
No
Yes
Yes
Yes
Automatically
Converted
Details
Yes
Yes
No
Issue 8811: PostgreSQL doesn't support the %s function (p. 234)
Issue 8811: PostgreSQL doesn't support the %s function (p. 234)
Issue 8811: PostgreSQL doesn't support the %s function (p. 234)
Yes
Version 1.0
223
Clause
LOWER()
LPAD()
LTRIM()
MAKE_SET()
MATCH
MID()
NOT REGEXP
NOT RLIKE
OCT()
OCTET_LENGTH()
ORD()
POSITION()
QUOTE()
REGEXP
REPEAT()
REPLACE()
REVERSE()
RIGHT()
RLIKE
RPAD()
RTRIM()
SOUNDEX()
SOUNDS LIKE
SPACE()
STRCMP()
SUBSTR()
SUBSTRING()
SUBSTRING_INDEX()
AWS Schema Conversion Tool User Guide
Functions
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Automatically
Converted
Details
Yes
Yes
Yes
Yes
No
Issue 8811: PostgreSQL doesn't support the %s function (p. 234)
No
Issue 8811: PostgreSQL doesn't support the %s function (p. 234)
Issue 8811: PostgreSQL doesn't support the %s function (p. 234)
Version 1.0
224
Clause
TO_BASE64()
TRIM()
UCASE()
UNHEX()
UPPER()
WEIGHT_STRING()
AWS Schema Conversion Tool User Guide
Data Types
Yes
Yes
Yes
No
Automatically
Converted
Details
No
Issue 8811: PostgreSQL doesn't support the %s function (p. 234)
Yes
Issue 8811: PostgreSQL doesn't support the %s function (p. 234)
XML
Clause
ExtractValue()
UpdateXML()
Automatically
Converted
Details
No
No
Issue 8811: PostgreSQL doesn't support the %s function (p. 234)
Issue 8811: PostgreSQL doesn't support the %s function (p. 234)
Data Types
Date and Time
Data type
DATE
DATETIME
TIME
TIMESTAMP
YEAR
YEAR (M)
Automatically
Converted to
date
Details
timestamp without time zone time timestamp without time zone smallint smallint
Version 1.0
225
AWS Schema Conversion Tool User Guide
Data Types
JSON
Data type
JSON
Automatically
Converted to
Details
Issue 8706: PostgreSQL doesn't support %s type (p. 236)
Numeric
Integer Types
Data type
BIGINT [SIGNED]
BIGINT UNSIGNED
BOOL
BOOLEAN
INT [INTEGER] [SIGNED]
INT [INTEGER] UNSIGNED
MEDIUMINT [SIGNED]
MEDIUMINT UNSIGNED
SMALLINT [SIGNED]
SMALLINT UNSIGNED
TINYINT [SIGNED]
TINYINT UNSIGNED
Automatically
Converted to
Details
bigint numeric boolean boolean
Issue 8848: In MySQL the BOOLEAN type is a synonym for TINYINT (p. 236)
Issue 8848: In MySQL the BOOLEAN type is a synonym for TINYINT (p. 236)
integer bigint integer integer smallint integer smallint smallint
Bit
Data type
BIT
Automatically
Converted to
Details
bit
Version 1.0
226
AWS Schema Conversion Tool User Guide
Data Types
Fixed-Point
Data type
DEC
DEC (p)
DEC (p,s)
DECIMAL
DECIMAL (p)
DECIMAL (p,s)
NUMERIC
NUMERIC (p)
NUMERIC (p,s)
Automatically
Converted to
Details
numeric numeric numeric numeric numeric numeric numeric numeric numeric
Floating-Point
Data type
DOUBLE
DOUBLE PRECISION
DOUBLE PRECISION (p)
DOUBLE PRECISION (p,s)
DOUBLE(p)
DOUBLE(p,s)
FLOAT
FLOAT(p)
FLOAT(p,s)
Automatically
Converted to
Details
double precision double precision double precision double precision double precision double precision real precision from 1-24: real precision >
24: double precision double precision
Version 1.0
227
AWS Schema Conversion Tool User Guide
Data Types
Data type
REAL
REAL(p)
REAL(p,s)
Spatial Data Types
Data type
GEOMETRY
GEOMETRYCOLLECTION
LINESTRING
MULTILINESTRING
MULTIPOINT
MULTIPOLYGON
POINT
POLYGON
Automatically
Converted to
Details
Issue 8706: PostgreSQL doesn't support %s type (p. 236)
Issue 8706: PostgreSQL doesn't support %s type (p. 236)
Issue 8706: PostgreSQL doesn't support %s type (p. 236)
Issue 8706: PostgreSQL doesn't support %s type (p. 236)
Issue 8706: PostgreSQL doesn't support %s type (p. 236)
Issue 8706: PostgreSQL doesn't support %s type (p. 236)
Issue 8706: PostgreSQL doesn't support %s type (p. 236)
Issue 8706: PostgreSQL doesn't support %s type (p. 236)
String
Automatically
Converted to
Details
double precision double precision double precision
Data type
BINARY
BLOB
Automatically
Converted to
Details
bytea bytea
Issue 8706: PostgreSQL doesn't support %s type (p. 236)
Issue 8706: PostgreSQL doesn't support %s type (p. 236)
Version 1.0
228
AWS Schema Conversion Tool User Guide
MySQL to PostgreSQL Conversion Reference
LONGBLOB
LONGTEXT
MEDIUMBLOB
MEDIUMTEXT
SET
TEXT
TINYBLOB
TINYTEXT
VARBINARY(len)
VARCHAR(len)
Data type
CHAR
CHAR(len)
ENUM
Automatically
Converted to
Details
char char
CREATE
ENUM user type bytea
Issue 8706: PostgreSQL doesn't support %s type (p. 236)
text bytea
Issue 8706: PostgreSQL doesn't support %s type (p. 236)
text
Issue 8706: PostgreSQL doesn't support %s type (p. 236)
text bytea
Issue 8706: PostgreSQL doesn't support %s type (p. 236)
text bytea
Issue 8706: PostgreSQL doesn't support %s type (p. 236)
varchar
MySQL to PostgreSQL Conversion Reference
BUILT-IN SQL FUNCTIONS
Item
Function
Function
Function
Function
Issue
Issue 8811: PostgreSQL doesn't support the
Issue 8849: PostgreSQL doesn't support the %s function with parameter values
Issue 8850: Some parameter values for the function %s aren't supported (p. 234)
Resolution
Create a user-defined function.
Create a user-defined function.
You need to check the result of the conversion
Perform a manual conversion.
Version 1.0
229
AWS Schema Conversion Tool User Guide
MySQL to PostgreSQL Conversion Reference
Item
Function
Issue
Issue 8854: PostgreSQL doesn't support the
%s function with parameters (p. 234)
Resolution
Perform a manual conversion.
CONTROL FLOW
Item
CURSORS
DECLARE / DEFAULT
VALUE
DECLARE / DEFAULT
VALUE error handling error handling error handling
LABEL
PROCESS_LIST
REPLICATION
SLEEP
Issue
Issue 8845: Rows count functionality is not supported behind the "open cursor" statement (p. 234)
Issue 8826: Check the default value for a Date or DateTime variable (p. 234)
Issue 8828: User-defined variables are not supported in PostgreSQL (p. 235)
Issue 8844: Error codes are not the same (p. 235)
Issue 8846: PostgreSQL doesn't support the statement option %s (p. 235)
Issue 8847: PostgreSQL isn't able to return to a call point after error handling (p. 235)
Issue 8827: Statement Label Syntax for
BEGIN...END blocks is not supported in
Issue 8856: The information of the server processes is different on different servers (p. 236)
Issue 8857: Automatic conversion for replication commands is not supported (p. 236)
Issue 8853: Perform a manual conversion if using SLEEP() with other expressions (p. 236)
Resolution
Perform a manual conversion.
Review generated code and modify it if necessary.
Perform a manual conversion.
You need to check the result of the conversion
Perform a manual conversion.
Perform a manual conversion.
Perform a manual conversion.
Check your conversion result.
Perform a manual conversion.
Perform a manual conversion.
CREATE
Item Issue
Issue 8654: Unable to convert object due to
Resolution
Review the %s object.
Version 1.0
230
AWS Schema Conversion Tool User Guide
MySQL to PostgreSQL Conversion Reference
DATATYPES
Item
BOOLEAN
DATATYPES
Issue
Issue 8848: In MySQL the BOOLEAN type is a synonym for TINYINT (p. 236)
Issue 8706: PostgreSQL doesn't support %s type (p. 236)
Resolution
Check it when you insert data from a BOOLEAN variables into the database.
To store data of this type in PostgreSQL, use a
PostgreSQL-compatible type or use a composite type.
DDL
Item
CREATE TABLE
DROP TABLE
Issue
Issue 8825: Check the default value for a Date or DateTime column (p. 236)
Issue 8801: The table can be locked open cursor (p. 237)
Resolution
Review generated code and modify it if necessary.
Review your transformed code and modify it if necessary.
DML
Item
DML
DML
DML
DML
DML
DML
SELECT
Issue
Issue 8829: PostgreSQL doesn't have an analog of clause ON DUPLICATE KEY
Issue 8830: PostgreSQL doesn't have an option similar to LOW_PRIORITY for DML statements (p. 237)
Issue 8831: PostgreSQL doesn't have an option similar to IGNORE for DML statements (p. 237)
Issue 8832: PostgreSQL doesn't have an option similar to QUICK for DML statements (p. 237)
Issue 8833: PostgreSQL can't make updates to several tables at the same time (p. 238)
Issue 8834: PostgreSQL can't delete from several tables at the same time (p. 238)
Issue 8835: PostgreSQL doesn't have an option similar to DELAYED for DML statements (p. 238)
Resolution
Perform a manual conversion.
Use DML statement without this option.
Use DML statement without this option.
Use DML statement without this option.
Perform a manual conversion.
Perform a manual conversion.
Use DML statement without this option.
Version 1.0
231
AWS Schema Conversion Tool User Guide
MySQL to PostgreSQL Conversion Reference
SELECT
SELECT
SELECT
SELECT
SELECT
SELECT
SELECT
WHERE
Item
SELECT
Issue
Issue 8836: PostgreSQL doesn't have an option similar to %s for DML statements (p. 238)
Issue 8837: PostgreSQL doesn't support clause STRAIGHT_JOIN (p. 238)
Issue 8838: PostgreSQL doesn't support clause SQL_SMALL_RESULT (p. 238)
Issue 8839: PostgreSQL doesn't support clause SQL_BIG_RESULT (p. 238)
Issue 8840: PostgreSQL doesn't support clause SQL_BUFFER_RESULT (p. 238)
Issue 8841: PostgreSQL doesn't support clause SQL_CACHE (p. 238)
Issue 8842: PostgreSQL doesn't support clause SQL_NO_CACHE (p. 238)
Issue 8843: PostgreSQL doesn't support clause SQL_CALC_FOUND_ROWS (p. 238)
Issue 8795: PostgreSQL is case sensitive.
Check the string comparison. (p. 238)
Resolution
Use DML statement without this option.
Use DML statement without this option
Use DML statement without this option
Use DML statement without this option
Use DML statement without this option
Use DML statement without this option
Use DML statement without this option
Use DML statement without this option
Check the string comparison.
EVENTS
Item
EVENTS
Issue
Issue 8855: Automatic conversion of EVENT syntax is not supported (p. 239)
Resolution
Perform a manual conversion.
EXECUTE
Item
EXECUTE a character string
Issue
Issue 8672: Automatic conversion of this command is not supported (p. 239)
Resolution
Perform a manual conversion.
Operators
Item Issue
Arithmetic operators
Resolution
Perform a manual conversion.
Version 1.0
232
AWS Schema Conversion Tool User Guide
MySQL to PostgreSQL Conversion Reference
Item Issue
Arithmetic operators
Parser Error
Item
Parser Error
Issue
Issue 8663: Unable to resolve the object (p. 239)
Resolution
Perform a manual conversion.
Resolution
Verify if object %s is present in the database. If it isn't, check the object name or add the object. If the object is present, transform the code manually.
SELECT
Item
GROUP BY
Issue
Issue 8653: PostgreSQL doesn't support the option GROUP BY ROLLUP (p. 240)
Resolution
Perform a manual conversion.
TRANSACTION
Item
TRANSACTION
Issue
Issue 8807: PostgreSQL doesn't support transactions in functions (p. 240)
Unknown
Item
Unknown Clause
Resolution
Perform a manual conversion.
Issue
Issue 8655: This syntactic element conversion is not supported yet (p. 240)
Issue 8674: Automatic conversion of %s clause of %s statement is not supported (p. 240)
Resolution
Perform a manual conversion.
Perform a manual conversion.
VIEW
Item
CREATE VIEV
Issue
Issue 8824: ALGORITHM option is not supported (p. 241)
Version 1.0
233
Resolution
Perform a manual conversion.
AWS Schema Conversion Tool User Guide
MySQL to PostgreSQL Conversion Reference
Conversion Issues with BUILT-IN SQL FUNCTIONS
Issue 8811: PostgreSQL doesn't support the %s function
Create a user-defined function.
Issue 8849: PostgreSQL doesn't support the %s function with parameter values
%s
Create a user-defined function.
Issue 8850: Some parameter values for the function %s aren't supported
Review the transformed code, and correct it if necessary.
Issue 8851: PostgreSQL doesn't support using aggregate functions in the
SELECT list without a GROUP BY clause
In MySQL, it is possible to use an aggregate function on a field in the SELECT list without adding the other fields in the SELECT list to a GROUP BY clause. In PostgreSQL, adding these fields to a GROUP BY clause is required. Perform a manual conversion in this case.
Issue 8854: PostgreSQL doesn't support the %s function with parameters
Perform a manual conversion.
Related Topics
•
MySQL to PostgreSQL Conversion Reference (p. 229)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with CONTROL FLOW
Issue 8845: Rows count functionality is not supported behind the "open cursor" statement
In PostgreSQL, the FOUND_ROWS() function can't be called within a cursor. Perform a manual conversion instead.
Issue 8826: Check the default value for a Date or DateTime variable
When converting default values for Date, Time, or DateTime variables, they are explicitly cast to the data type of the target variable. For example, the following MySQL code:
DECLARE ValueDate1 DATE DEFAULT '2000-01-01';
Is converted to the following PostgreSQL code:
ValueDate1 DATE DEFAULT '2000-01-01'::DATE;
If the default value is of the form '0000-00-00' or similar ('0000-00-00', '0000-00-00 00:00:00',
'0000-00-00 00:00:00.000000'), it is converted to the literal 'epoch'. For example, the following MySQL code:
Version 1.0
234
AWS Schema Conversion Tool User Guide
MySQL to PostgreSQL Conversion Reference
DECLARE ValueDate2 DATE DEFAULT '0000-00-00';
Is converted to the following PostgreSQL code:
ValueDate2 DATE DEFAULT 'epoch'::DATE;
In these cases, the default value must be manually updated. Review the generated code and modify it if necessary.
Issue 8828: User-defined variables are not supported in PostgreSQL
Perform a manual conversion.
Issue 8844: Error codes are not the same
Some exit handler conditions require manual conversion. MySQL code with any of the following exit handler statements must be converted to use PostgreSQL error handling with OTHERS or SQLSTATE conditions instead:
DECLARE EXIT HANDLER FOR SQLWARNING, SQLEXCEPTION, NOT FOUND
DECLARE EXIT HANDLER FOR SQLWARNING
DECLARE EXIT HANDLER FOR SQLEXCEPTION
DECLARE EXIT HANDLER FOR NOT FOUND
DECLARE EXIT HANDLER FOR SQLWARNING, NOT FOUND
DECLARE EXIT HANDLER FOR <mysql_error_code>
DECLARE EXIT HANDLER FOR SQLSTATE <sqlstate_value>
Review the transformed code, and correct it if necessary.
Issue 8846: PostgreSQL doesn't support the statement option %s
Some of the condition information items that are used with the DECLARE CONDITION and GET
DIAGNOSTICS CONDITION statements in MySQL are not supported by PostgreSQL. These include:
• CLASS_ORIGIN
• SUBCLASS_ORIGIN
• MYSQL_ERRNO
• CONSTRAINT_CATALOG
• CONSTRAINT_SCHEMA
• CATALOG_NAME
• CURSOR_NAME
Manually convert the code wherever you use these condition information items.
Issue 8847: PostgreSQL isn't able to return to a call point after error handling
If an error occurs in a BEGIN...END block, PostgreSQL exits the block without executing any further statements in that block. Check your error handling logic and perform a manual conversion instead.
Issue 8827: Statement Label Syntax for BEGIN...END blocks is not supported in
PostgreSQL
Perform a manual conversion.
Version 1.0
235
AWS Schema Conversion Tool User Guide
MySQL to PostgreSQL Conversion Reference
Issue 8856: The information of the server processes is different on different servers
Check your conversion result.
Issue 8857: Automatic conversion for replication commands is not supported
Perform a manual conversion for all replication-related code.
Issue 8853: Perform a manual conversion if using SLEEP() with other expressions
If you are using SLEEP() in a SELECT statement along with other expressions, for example
SELECT NOW(),
SLEEP(2), AccountNo FROM Account
, you must manually convert that code.
Related Topics
•
MySQL to PostgreSQL Conversion Reference (p. 229)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with CREATE
Issue 8654: Unable to convert object due to %s not created
Review the %s object.
Related Topics
•
MySQL to PostgreSQL Conversion Reference (p. 229)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with DATATYPES
Issue 8848: In MySQL the BOOLEAN type is a synonym for TINYINT
Check your code wherever you insert data from a BOOLEAN variable into the database.
Issue 8706: PostgreSQL doesn't support %s type
To store data of this type in PostgreSQL, use a PostgreSQL-compatible type or use a composite type.
Related Topics
•
MySQL to PostgreSQL Conversion Reference (p. 229)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with DDL
Issue 8825: Check the default value for a Date or DateTime column
When converting default values for Date, Time, or DateTime variables, they are explicitly cast to the data type of the target variable. For example, the following MySQL code:
Version 1.0
236
AWS Schema Conversion Tool User Guide
MySQL to PostgreSQL Conversion Reference
DECLARE ValueDate1 DATE DEFAULT '2000-01-01';
Is converted to the following PostgreSQL code:
ValueDate1 DATE DEFAULT '2000-01-01'::DATE;
If the default value is of the form '0000-00-00' or similar ('0000-00-00', '0000-00-00 00:00:00',
'0000-00-00 00:00:00.000000'), it is converted to the literal 'epoch'. For example, the following MySQL code:
DECLARE ValueDate2 DATE DEFAULT '0000-00-00';
Is converted to the following PostgreSQL code:
ValueDate2 DATE DEFAULT 'epoch'::DATE;
In these cases, the default value must be manually updated. Review the generated code and modify it if necessary.
Issue 8801: The table can be locked open cursor
The conversion uses the DROP TABLE IF EXISTS statement to remove a temporary table before the end of the function in which it was created. In some cases though, this statement might fail because the temporary table is locked due to an open cursor. In this case, the DROP TABLE statement must be commented out. Review your transformed code and modify it if necessary.
Related Topics
•
MySQL to PostgreSQL Conversion Reference (p. 229)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with DML
Issue 8829: PostgreSQL doesn't have an analog of clause ON DUPLICATE KEY
UPDATE
Perform a manual conversion.
Issue 8830: PostgreSQL doesn't have an option similar to LOW_PRIORITY for
DML statements
Use the DML statement without this option.
Issue 8831: PostgreSQL doesn't have an option similar to IGNORE for DML statements
Use the DML statement without this option.
Issue 8832: PostgreSQL doesn't have an option similar to QUICK for DML statements
Use the DML statement without this option.
Version 1.0
237
AWS Schema Conversion Tool User Guide
MySQL to PostgreSQL Conversion Reference
Issue 8833: PostgreSQL can't make updates to several tables at the same time
PostgreSQL doesn't support using an UPDATE statement to update several tables at once, for example update Account, Customer set Account.AccountBalance = Account.AccountBalance + 100,
Customer.SName = 'Sofan Hubert'
. Perform a manual conversion in this case.
Issue 8834: PostgreSQL can't delete from several tables at the same time
PostgreSQL doesn't support using a DELETE statement to delete several tables at once, for example delete table1, table3
. Perform a manual conversion in this case.
Issue 8835: PostgreSQL doesn't have an option similar to DELAYED for DML statements
Use the DML statement without this option.
Issue 8836: PostgreSQL doesn't have an option similar to %s for DML statements
Use the DML statement without this option.
Issue 8837: PostgreSQL doesn't support clause STRAIGHT_JOIN
Use the DML statement without this option
Issue 8838: PostgreSQL doesn't support clause SQL_SMALL_RESULT
Use the DML statement without this option
Issue 8839: PostgreSQL doesn't support clause SQL_BIG_RESULT
Use the DML statement without this option
Issue 8840: PostgreSQL doesn't support clause SQL_BUFFER_RESULT
Use the DML statement without this option
Issue 8841: PostgreSQL doesn't support clause SQL_CACHE
Use the DML statement without this option
Issue 8842: PostgreSQL doesn't support clause SQL_NO_CACHE
Use the DML statement without this option
Issue 8843: PostgreSQL doesn't support clause SQL_CALC_FOUND_ROWS
Use the DML statement without this option
Issue 8795: PostgreSQL is case sensitive. Check the string comparison.
Check string comparisons in the WHERE clauses of statements, for example
WHERE [Name] LIKE
'%BLOCKED%';
. All strings used in comparisons must be lowercase.
Related Topics
•
MySQL to PostgreSQL Conversion Reference (p. 229)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Version 1.0
238
AWS Schema Conversion Tool User Guide
MySQL to PostgreSQL Conversion Reference
Conversion Issues with EVENTS
Issue 8855: Automatic conversion of EVENT syntax is not supported
Event-related statements like CREATE EVENT or DROP EVENT are not supported in PostgreSQL. Perform a manual conversion of this code.
Related Topics
•
MySQL to PostgreSQL Conversion Reference (p. 229)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with EXECUTE
Issue 8672: Automatic conversion of this command is not supported
Code that uses the PREPARE...EXECUTE...DEALLOCATE PREPARE statements can't be automatically converted. Perform a manual conversion instead.
Related Topics
•
MySQL to PostgreSQL Conversion Reference (p. 229)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Operators
Issue 8773: The tool can not currently perform automated migration of arithmetic operations with dates
Perform a manual conversion.
Issue 8774: The tool can not currently perform automated migration of arithmetic operations with mixed types of operands
Code that uses an arithmetic operator and has one operand that has a DATE, TIME or TIMESTAMP data type can't be automatically converted. For example, set d = now() + 1;
. Perform a manual conversion instead.
Related Topics
•
MySQL to PostgreSQL Conversion Reference (p. 229)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Parser Error
Issue 8663: Unable to resolve the object
Verify if object %s is present in the database. If it isn't, check the object name or add the object. If the object is present, transform the code manually.
Version 1.0
239
AWS Schema Conversion Tool User Guide
MySQL to PostgreSQL Conversion Reference
Related Topics
•
MySQL to PostgreSQL Conversion Reference (p. 229)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with SELECT
Issue 8653: PostgreSQL doesn't support the option GROUP BY ROLLUP
PostgreSQL doesn't support the GROUP BY <field_name> WITH ROLLUP clause for the SELECT statement. Perform a manual conversion of this code.
Related Topics
•
MySQL to PostgreSQL Conversion Reference (p. 229)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with TRANSACTION
Issue 8807: PostgreSQL doesn't support transactions in functions
Code that uses transaction management statements such as START TRANSACTION or COMMIT within a function or stored procedure can't be automatically converted. Perform a manual conversion instead.
Related Topics
•
MySQL to PostgreSQL Conversion Reference (p. 229)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Unknown
Issue 8655: This syntactic element conversion is not supported yet
Perform a manual conversion.
Issue 8674: Automatic conversion of %s clause of %s statement is not supported
This error is typically raised by code that sets transaction options or replication-related variables that aren't supported in PostgreSQL. Such code must be manually converted. Statements that raise this error include the following:
• SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
• SET TRANSACTION READ ONLY;
• SET SESSION TRANSACTION READ WRITE;
• SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
• SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
• SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
Version 1.0
240
AWS Schema Conversion Tool User Guide
Oracle to MySQL Supported Schema Conversion
• SET GLOBAL TRANSACTION READ WRITE;
• SET GLOBAL tx_isolation=<isolation_level>;
• SET SQL_LOG_BIN=<value>;
• SET GLOBAL sql_slave_skip_counter=<value>;
Related Topics
•
MySQL to PostgreSQL Conversion Reference (p. 229)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with VIEW
Issue 8824: ALGORITHM option is not supported
PostgreSQL doesn't support the ALGORITHM clause for the CREATE VIEW or ALTER VIEW statements.
Perform a manual conversion in this case.
Related Topics
•
MySQL to PostgreSQL Conversion Reference (p. 229)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Related Topics
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Oracle to MySQL Supported Schema Conversion
The following sections list the schema elements from an Oracle database and whether they are supported for automatic conversion to MySQL using the AWS Schema Conversion Tool.
Topics
•
•
•
•
•
•
•
•
Data Definition Language (DDL) (p. 262)
•
•
•
•
Version 1.0
241
AWS Schema Conversion Tool User Guide
Statements
Statements
Topics
•
•
•
•
•
•
•
SELECT
Clause
WITH
AS
SELECT
DISTINCT | UNIQUE | ALL select_list
BULK COLLECT INTO
INTO record_name
FROM
@dblink materialized view
TABLE
(collection_expression)
MODEL
START WITH
CONNECT BY
PIVOT
XML
UNPIVOT
No
No
No
No
No
No
Yes
No
Yes
No
No
No
Yes
Yes
Yes
No
Automatically
Converted
Details
No Use a stored procedure to prepare data, or rewrite your query to avoid the WITH clause.
No
You can try to include all of the fields from your table in an INTO clause.
MySQL doesn't support the MODEL statement.
MySQL doesn't support hierarchical queries. Use a stored procedure to prepare data.
MySQL doesn't support hierarchical queries. Use a stored procedure to prepare data.
Version 1.0
242
AWS Schema Conversion Tool User Guide
Statements
Clause
WHERE
GROUP BY
CUBE
GROUPING SETS
HAVING
ORDER BY
SIBLINGS
NULLS FIRST | NULLS LAST No
Yes
Yes
No
Automatically
Converted
Details
Yes
Yes
No
No
Use a stored procedure to prepare data.
Use a stored procedure to prepare data.
MySQL doesn't support NULLS FIRST and NULLS LAST.
In MySQL NULL sorting, NULL values go first for an ascending order and last for a descending order. Try rewriting the ORDER BY clause with CASE.
FOR UPDATE
OF
NOWAIT | WAIT
Yes
No
No
Try using FOR UPDATE instead of FOR UPDATE OF.
MySQL doesn't support WAIT and NOWAIT clauses. Try using FOR UPDATE without NOWAIT.
Try using FOR UPDATE without SKIP LOCKED.
SKIP LOCKED
UNION
INTERSECT | MINUS]
No
Yes
Yes
INSERT
Clause
INTO table
PARTITION
PARTITION FOR
SUBPARTITION
VIEW
MATERIALIZED VIEW subquery
WITH table_collection_expression
No
No
No
Automatically
Converted
Details
Yes
Yes
No
No
No
Either insert data into the overlying partition, or perform a manual conversion using the INSERT statement.
Target a table with the INSERT statement instead of a
VIEW. If the target view has an INSTEAD OF trigger, parse and execute the INSTEAD OF trigger code.
Perform a manual conversion.
Perform this operation on the underlying tables instead.
Version 1.0
243
AWS Schema Conversion Tool User Guide
Statements
Clause
column …
VALUES subquery
RETURNING … INTO
LOG ERRORS
Automatically
Converted
Details
Yes
Yes
Yes
No
No
To perform this operation, divide the INSERT statement with the RETURNING clause into an INSERT statement with following SELECT statements and use the same key conditions in each SELECT. You can also use the last value that was generated by AUTO_INCREMENT column in the key condition.
You can add error records by inserting them into the log in the exception block. Iterate through the errors in the exception block, add them to the log, and use the EXIT command when finished.
UPDATE
Clause
UPDATE [hint] table
PARTITION
PARTITION FOR
SUBPARTITION
VIEW
MATERIALIZED VIEW subquery
WITH
No
No table_collection_expression Yes
Yes SET
VALUE
WHERE condition
RETURNING ... INTO
LOG ERRORS
Automatically
Converted
Details
Yes
Yes
Yes
No
No
No
No
Either insert data into the overlying partition, or perform a manual transformation using the UPDATE statement.
Perform an update on the underlying tables instead.
Yes
No
No
Perform this operation on the underlying tables instead.
To perform this operation, divide the UPDATE statement with the RETURNING clause into an UPDATE statement with following INSERT statements that have the specified key conditions in the SELECT part.
You can add error records by inserting them into the log in the exception block. Iterate through the errors in the
Version 1.0
244
AWS Schema Conversion Tool User Guide
Statements
Clause Automatically
Converted
Details
exception block, add them to the log, and use the EXIT command when finished.
Note
MySQL doesn't support FILESTREAM DATA. Perform a manual conversion to update the data in the file system file.
DELETE
Clause
DELETE
FROM
PARTITION
PARTITION FOR
SUBPARTITION
VIEW
MATERIALIZED VIEW subquery
WITH table_collection_expression Yes
WHERE condition Yes
RETURNING … INTO No
LOG ERRORS
No
No
No
Automatically
Converted
Details
Yes
Yes
Yes
No Either insert data into the overlying partition, or perform a manual transformation using the DELETE statement.
No
No Perform a manual conversion.
Perform a manual conversion.
Perform this operation on the underlying tables instead.
No
To perform this operation, divide the DELETE statement with the RETURNING clause into a DELETE statement with following INSERT statements and use the same key conditions in each SELECT.
You can add error records by inserting them into the log in the exception block. Iterate through the errors in the exception block, add them to the log, and use the EXIT command when finished.
MERGE
Statement
MERGE
Automatically
Converted
Details
No To achieve the effect of a MERGE statement, use separate
INSERT, DELETE, and UPDATE statements.
Version 1.0
245
AWS Schema Conversion Tool User Guide
Procedures
TRUNCATE
Clause
TRUNCATE TABLE
PRESERVE MATERIALIZED
VIEW LOG
PURGE MATERIALIZED
VIEW LOG
DROP STORAGE
REUSE STORAGE
Automatically
Converted
Details
Yes
No
No
No
No
LOCK TABLE
Clause
PARTITION
SUBPARTITION
NOWAIT
Procedures
Item
LOCK TABLE dbms_output.put_line
dbms_output.put
Automatically
Converted
Details
No
No
No
Automatically
Converted
Details
No
No
No
MySQL doesn't support the LOCK TABLE statement inside a stored procedure.
Try using INSERT in the log table. To do this, you must add code into AWS_ORACLE_EXT.PUT_LINE.
Try using INSERT in the log table. To do this, you must add code into AWS_ORACLE_EXT.PUT.
Flow Control
Clause
GOTO
FORALL
EXECUTE IMMEDIATE
BULK COLLECT
Automatically
Converted
Details
No
No
No
No
Try using a WHILE DO statement.
Version 1.0
246
AWS Schema Conversion Tool User Guide
Packages
Clause
RETURNING BULK COLLECT
INTO
LABEL No
Automatically
Converted
Details
No
Try rewriting variables without using labels.
Packages
Item
Initialization block, BEGIN
… END
User type
Global cursor
Global user exception
No
No
No
Automatically
Converted
Details
Partial MySQL doesn't support EXCEPTION BLOCK in initialization blocks in packages. Try using CONTINUE
HANDLER.
Functions
Topics
•
•
Date and Time Functions (p. 249)
•
Mathematical Functions (p. 250)
•
Character (String) Functions (p. 251)
•
•
General Comparison Functions (p. 254)
•
Encoding and Decoding Functions (p. 254)
•
•
•
•
•
User-Defined Functions (p. 255)
•
Large Object Functions (p. 256)
•
Hierarchical Functions (p. 256)
•
In this section, you can find a list of the Microsoft SQL Server built-in functions that indicates whether the AWS Schema Conversion Tool performs an automatic conversion. Where MySQL doesn't support a function, consider creating a user-defined function.
Version 1.0
247
AWS Schema Conversion Tool User Guide
Functions
AVG
COLLECT
CORR
CORR_*
COUNT
COVAR_POP
COVAR_SAMP
CUME_DIST
DENSE_RANK
FIRST
GROUP_ID
GROUPING
GROUPING_ID
LAST
MAX
MEDIAN
MIN
PERCENTILE_CONT
PERCENTILE_DISC
PERCENT_RANK
RANK
REGR_ (Linear Regression)
Functions
STATS_BINOMIAL_TEST
STATS_CROSSTAB
STATS_F_TEST
STATS_KS_TEST
STATS_MODE
STATS_MW_TEST
STATS_ONE_WAY_ANOVA
Aggregate Functions
Function
No
No
No
No
No
Yes
No
Yes
No
No
No
No
No
No
No
Yes
No
No
No
No
No
Automatically
Converted
Details
Yes
No
No
No
No
No
No
No
Version 1.0
248
AWS Schema Conversion Tool User Guide
Functions
Function
STATS_T_TEST_*
STATS_WSR_TEST
STDDEV
STDDEV_POP
STDDEV_SAMP
SUM
TRUNC
VAR_POP
VAR_SAMP
VARIANCE
Yes
Yes
Yes
Yes
Yes
Yes
Automatically
Converted
Details
No
No
Yes
Yes
Converts to: TRUNCATE()
Date and Time Functions
Function Automatically
Converted
Details
ADD_MONTHS(date, num) Partial
CURRENT_DATE Partial
CURRENT_TIMESTAMP Partial
Converts to: TIMESTAMPADD(MONTH, num, date)
Converts to: NOW()
Converts to: NOW()
DBTIMEZONE No
EXTRACT(YEAR FROM date) Partial
EXTRACT(MONTH FROM date)
Partial
EXTRACT(DAY FROM date) Partial
Partial EXTRACT(HOUR FROM time)
EXTRACT(MINUTE FROM time)
EXTRACT(SECOND FROM time)
FROM_TZ
LAST_DAY(date)
LOCALTIMESTAMP
Partial
Partial
No
Yes
Yes
Converts to: YEAR(date)
Converts to: MONTH(date)
Converts to: DAY(date)
Converts to: HOUR(time)
Converts to: MINUTE(time)
Converts to: SECOND(time)
Version 1.0
249
AWS Schema Conversion Tool User Guide
Functions
Function
LOCALTIMESTAMP(prec)
MONTHS_BETWEEN(date1, date2)
NEW_TIME
NEXT_DAY
NUMTODSINTERVAL
NUMTOYMINTERVAL
ROUND (date)
SESSIONTIMEZONE
SYS_EXTRACT_UTC
SYSDATE
SYSTIMESTAMP
TO_CHAR (datetime, format)
Automatically
Converted
Details
Partial The maximum precision for the MySQL
LOCALTIMESTAMP function is 6. If you need greater precision, create a user-defined function.
No
No
No
No
No
No
No
No
Partial
Partial
Partial
Converts to: SYSDATE()
Converts to: CURRENT_TIMESTAMP
Converts to: DATE_FORMAT()
Note that the TO_CHAR and DATE_FORMAT format strings are different.
TO_TIMESTAMP(exp)
TO_TIMESTAMP_TZ
TO_DSINTERVAL
TO_YMINTERVAL
TRUNC (datetime)
TZ_OFFSET
No
No
No
No
Partial
No
Converts to: DATE(datetime)
Mathematical Functions
Function
ABS(num)
ACOS(num)
ASIN(num)
ATAN(num)
ATAN2(x,y)
Automatically
Converted
Details
Yes
Yes
Yes
Yes
Yes
Version 1.0
250
AWS Schema Conversion Tool User Guide
Functions
Function
BITAND(exp1, exp2)
CEIL(num)
COS(num)
COSH(num)
EXP(n)
FLOOR(num)
LN(num)
LOG(num1, num2)
MOD(dividend, divisor)
NANVL(n2, n1)
POWER(value, n)
REMAINDER(n1, n2)
ROUND (num, integer)
SIGN(exp)
SIN(num)
SINH(num)
SQRT(num)
TAN(num)
TANH(num)
TRUNC (number)
TRUNC(num, num2)
VALUE(variable)
WIDTH_BUCKET
Yes
No
No
Yes
Yes
Partial
Yes
Yes
Yes
Yes
Partial
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Automatically
Converted
Details
Partial Converts to: (exp1 & exp2)
Yes
Yes
Partial Converts to: (EXP(num) + EXP(-num)) / 2
Converts to: (n1 - n2*ROUND(n1/n2))
Converts to: TRUNCATE(num, 0)
Character (String) Functions
Function
ASCII(str)
CHR(num)
CONCAT(char1, char2)
INITCAP(string)
Automatically
Converted
Details
Yes
Partial
Yes
No
Converts to: CHAR(num USING ASCII)
Version 1.0
251
AWS Schema Conversion Tool User Guide
Functions
NLS_INITCAP
NLS_LOWER
NLS_UPPER
NLSSORT
REGEXP_INSTR
REGEXP_REPLACE
REGEXP_SUBSTR
REPLACE(str, search)
REPLACE(str, search, replace)
RPAD(string, len)
RPAD(string, len, pad)
RTRIM(string)
RTRIM(string, set)
SOUNDEX(string)
SUBSTR(string, pos, len)
TRANSLATE(string, from, to)
TREAT
TRIM([type trim FROM] string)
Function
INSTR(str, substr)
INSTR(str, substr, pos)
INSTR(str, substr, pos, num) No
LENGTH(string) Partial
LOWER(string)
LPAD(string, len)
Yes
Partial
LPAD(string, len, pad)
LTRIM(string)
LTRIM(string, set)
Yes
Yes
Partial
Automatically
Converted
Details
Yes
Partial Converts to: LOCATE (substr, str, pos)
This function is the same as the two-argument form of INSTR(), except that the order of the arguments is reversed.
Converts to: LENGTH (string)
Converts to: LPAD(string, len, ' ')
Converts to: TRIM(LEADING set FROM string)
No
No
No
No
No
No
No
Partial
Yes
Converts to: REPLACE(str, search, '')
Partial
Yes
Yes
Partial
Yes
Yes
No
Yes
Converts to: RPAD(string, len, ' ')
Converts to: TRIM(TRAILING set FROM string)
Version 1.0
252
AWS Schema Conversion Tool User Guide
Functions
Function
UPPER(string)
Automatically
Converted
Details
Yes
Conversion Functions
Function
ASCIISTR(string)
Automatically
Converted
Details
No
BIN_TO_NUM(bit1, bit2, …) No
CAST Yes
CHARTOROWID No
COMPOSE
CONVERT(string, charset)
DECOMPOSE
HEXTORAW
NUMTODSINTERVAL
NUMTOYMINTERVAL
RAWTOHEX
No
Partial
No
No
No
No
No
Converts to: CONVERT(string USING charset)
RAWTONHEX
ROWIDTOCHAR
ROWIDTONCHAR
SCN_TO_TIMESTAMP
TIMESTAMP_TO_SCN
TO_BINARY_DOUBLE
TO_BINARY_FLOAT
TO_CHAR (character)
TO_CHAR (datetime, format)
No
No
No
No
No
No
No
No
Partial
TO_CHAR (number, format) Partial
Converts to: DATE_FORMAT(datetime, format)
Note that the TO_CHAR and DATE_FORMAT format strings are different.
Converts to: FORMAT(number, decimal_digits)
In MySQL, you can use FORMAT function as well as other string functions and expressions.
TO_CLOB
TO_DATE
Partial
Partial Converts to: STR_TO_DATE(string, format)
Version 1.0
253
AWS Schema Conversion Tool User Guide
Functions
Function
TO_DSINTERVAL
TO_LOB
TO_MULTI_BYTE
TO_NCHAR (character)
TO_NCHAR (datetime)
TO_NCHAR (number)
TO_NCLOB
TO_NUMBER
TO_DSINTERVAL
TO_SINGLE_BYTE
TO_TIMESTAMP
TO_TIMESTAMP_TZ
TO_YMINTERVAL
TRANSLATE ... USING
UNISTR
No
No
No
No
No
No
No
No
No
No
Automatically
Converted
Details
Note that the TO_DATE and STR_TO_DATE format strings are different.
No
No
No
No
Partial Converts to: CHAR(string USING UCS2)
General Comparison Functions
Function
GREATEST(exp, exp2, …)
LEAST(exp, exp2, …)
Automatically
Converted
Details
Yes
Yes
Encoding and Decoding Functions
Function Automatically
Converted
Details
Partial Converts to: CASE expression DECODE(exp, when, then, ...)
DUMP
ORA_HASH
VSIZE
No
No
No
Version 1.0
254
AWS Schema Conversion Tool User Guide
Functions
MySQL doesn’t support sending e-mail. To send email, use Amazon Simple Email Service (Amazon SES).
HTTP
MySQL doesn't support sending messages to HTTP endpoints. To send messages to HTTP and HTTPS endpoints, you can use the Amazon Simple Notification Service (Amazon SNS).
SMS
MySQL doesn't support sending notifications by using SMS. To send and receive SMS notifications, you can use the Amazon Simple Notification Service (Amazon SNS).
NULL Functions
Function
COALESCE(exp1, exp2, …)
LNNVL
NULLIF(exp1, exp2)
NVL(exp, replacement)
NVL2(exp1, exp2, exp3)
Automatically
Converted
Details
Yes
No
Partial
Partial
Partial
Converts to: NULLIF(exp1, exp2)
Converts to: IFNULL(exp, replacement)
Converts to: CASE expression
User-Defined Functions
Return
In MySQL, you can use statements that return a result set within a stored procedure but not within a stored function.
Statement
RETURN resultset
RETURN record-type
TYPE .. IS TABLE OF ..
INDEX BY
TYPE .. IS TABLE OF
TYPE .. IS VARRAY(..) OF
RETURN .. PIPELINED
Automatically
Converted
Details
No Try changing the function to a stored procedure and use a table to store the results.
No
No
No
No
No
Try changing the function to a stored procedure and change record-type items to separate parameters.
Try changing the function to a stored procedure and use a table to store the results.
Try changing the function to a stored procedure and use a table to store the results.
Try changing the function to a stored procedure and use a table to store the results.
Try changing the function to a stored procedure and use a table to store the results.
Version 1.0
255
AWS Schema Conversion Tool User Guide
Functions
Statement
TYPE ... IS REF CURSOR object-type
Collections
Item
TYPE .. IS TABLE OF… collection_name.First, collection_name.Last, collection_name.Count, collection_name.Next
:= collection_type(...)
Automatically
Converted
Details
No Try changing the function to a stored procedure and use a table to store the results.
No
Automatically
Converted
Details
No
No
MySQL doesn't support table type variables. Try using a table.
MySQL doesn't support table type collection methods.
Try using a table.
No MySQL doesn't support the constructor for the collection type. Try using a table.
Arguments
Item
UDT record-type
UDT collection-type
UDT object-type
Automatically
Converted
Details
No
No
No
Large Object Functions
Function
BFILENAME
EMPTY_BLOB
EMPTY_CLOB
Automatically
Converted
Details
No
Partial
Partial
Converts to an empty string.
Converts to an empty string.
Hierarchical Functions
Function
SYS_CONNECT_BY_PATH
Automatically
Converted
Details
No Try creating a user-defined function.
Version 1.0
256
AWS Schema Conversion Tool User Guide
Operators
Analytic Functions
MySQL doesn't support analytic functions. Try creating a user-defined function.
Operators
Topics
•
•
•
•
•
String Concatenation Operator (p. 258)
•
Date and time format specifiers (p. 258)
Arithmetic Operators
Clause
-
+
+ -
* /
Automatically
Converted
Details
Yes
Yes
Partial MySQL handles date and time arithmetic differently.
Verify that the converted schema is accurate.
Yes
Assignment Operator
Clause
=
Automatically
Converted
Details
Yes
<=
<>
!=
>
<
>=
!<
Comparison Operators
Clause
Yes
Yes
Yes
Yes
Automatically
Converted
Details
Yes
Yes
Yes
Version 1.0
257
AWS Schema Conversion Tool User Guide
Operators
Clause
!>
Automatically
Converted
Details
Yes
IN
NOT IN
ANY
SOME
ALL
BETWEEN x
EXISTS
LIKE
IS NULL
NOT
AND
OR
Logical Operators
Clause
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Automatically
Converted
Details
Yes
Yes
String Concatenation Operator
Clause
||
Automatically
Converted
Details
Yes
YEAR
YYYY
YYY
YY
Y
Date and time format specifiers
Clause Automatically
Converted
Default Conversion
No
Partial
No
Partial
No
%Y
%y
Version 1.0
258
AWS Schema Conversion Tool User Guide
Operators
Clause
HH24
MI
SS
SSSSS
FF
AM, PM
A.M., P.M.
AD or A.D
IYY
I
IY
IYYY
RRRR
Q
MM
MON
MONTH
RM
DAY
DD
DDD
DY
J
HH
HH12
WW
W
IW
D
Day of the week (1=Sunday,
7=Saturday)
Partial
Partial
Partial
No
No
Partial
No
No
Partial
Partial
Partial
Partial
No
Partial
Partial
No
No
Partial
Partial
Partial
No
Automatically
Converted
Default Conversion
No
%y Partial
No
Partial %Y
%m
%b
%M
Partial
No
Partial
Partial
Partial
%V
%V
%w
Day of the week (0=Sunday, 6=Saturday)
%W
%e
%j
%a
%h
%h
%H
%i
%S
%p
Version 1.0
259
Clause
BC or B.C.
TZD
TZH
TZM
TZR
Data Types
Data type
BFILE
AWS Schema Conversion Tool User Guide
Data Types
No
No
No
Automatically
Converted
Default Conversion
No
No
Automatically
Converted
Default Conversion
Partial VARCHAR(255)
BINARY_FLOAT
BINARY_DOUBLE
BLOB
CHAR
CHAR(n), CHARACTER(n)
CHAR(n), CHARACTER(n)
CLOB
DATE
DECIMAL, DEC
DECIMAL(p,s), DEC(p,s)
DOUBLE PRECISION
FLOAT
FLOAT(p)
INTEGER, INT
Yes
Yes
INTERVAL YEAR TO MONTH Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
FLOAT
DOUBLE
LONGBLOB
TEXT
CHAR(n), CHARACTER(n)
VARCHAR(n)
LONGTEXT
DATETIME
DOUBLE
DECIMAL(p,s), DEC(p,s)
DOUBLE PRECISION
DOUBLE
DOUBLE
DECIMAL(38)
DOUBLE
Details
Contains the file path to the BFILE. MySQL does not support the BFILE. Because
BFILE data is made up of the path to a file, you can either store a filename and create a routine that gets the file from the file system, or store the file contents as a LONGBLOB.
Version 1.0
260
AWS Schema Conversion Tool User Guide
Data Types
Data type Automatically
Converted
Default Conversion
VARCHAR(30) INTERVAL YEAR(p) TO
MONTH
Yes
INTERVAL DAY TO SECOND Yes VARCHAR(30)
INTERVAL DAY(p) TO
SECOND(s)
LONG
Yes
Yes
VARCHAR(30)
LONGTEXT
LONG RAW
NCHAR
NCHAR(n)
NCHAR(n)
NCHAR VARYING
NCHAR VARYING(n)
Yes
Yes
Yes
Yes
Yes
Yes
LONGBLOB
TEXT
NCHAR(n)
NVARCHAR(n)
TEXT
NCHAR VARYING(n)
NCLOB
NUMBER(p,0), NUMBER(p) Yes
NUMBER(p,s)
NUMBER,
NUMBER(*),NUMERIC
NUMERIC(p,s)
NVARCHAR2
NVARCHAR2(n)
RAW
RAW(n)
RAW(n)
REAL
ROWID
SMALLINT
TIMESTAMP
TIMESTAMP(p)
TIMESTAMP(p)
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Partial
LONGTEXT
DECIMAL(p,0), DECIMAL(p)
DECIMAL(p,s)
DOUBLE
NUMERIC(p,s)
TEXT
NVARCHAR(n)
VARBINARY(2000)
BINARY(n)
VARBINARY(n)
DOUBLE
CHAR(10)
DECIMAL(38)
DATETIME
DATETIME(p)
Details
MySQL expands fractional seconds support for
TIME, DATETIME, and
TIMESTAMP values, with up to microseconds (6 digits) precision.
Version 1.0
261
AWS Schema Conversion Tool User Guide
Data Definition Language (DDL)
Data type
TIMESTAMP(p) WITH TIME
ZONE
Automatically
Converted
Default Conversion
Partial DATETIME
Details
There is not a data type in MySQL that can store time zone information.
DATETIME data type stores timestamps in the MySQL server time zone.
UROWID
UROWID(n)
VARCHAR
VARCHAR(n)
VARCHAR2
VARCHAR2(n)
XMLTYPE
Yes
Yes
Yes
Yes
Yes
Yes
Yes
TEXT
VARCHAR(n)
TEXT
VARCHAR(n)
TEXT
VARCHAR(n)
LONGTEXT
Data Definition Language (DDL)
Topics
•
•
•
•
•
•
CREATE TABLE
CREATE TABLE statements are converted automatically except for the following.
Clause
OBJECT TABLE
CLUSTERED TABLE
EXTERNAL TABLE
GLOBAL TEMPORARY
TABLE
Automatically converted
Details
No
No
MySQL doesn't support OBJECT TABLE. Revise your code to avoid OBJECT TABLE.
MySQL doesn't support CLUSTERED TABLE. Try using a table with triggers.
No
No
MySQL doesn't support EXTERNAL TABLE. Try using a table.
MySQL doesn't support GLOBAL TEMPORARY TABLE. Try using a temporary table.
Version 1.0
262
AWS Schema Conversion Tool User Guide
Data Definition Language (DDL)
Clause
Partitioned tables
Virtual columns
Automatically converted
Details
No
No
MySQL doesn't support all partition types. Perform a manual conversion for the partition types that aren't supported.
MySQL doesn't support virtual columns. Represent virtual columns using a view.
Functions as default values No
NESTED TABLE columns
COLUMN(TABLE)
No
No
MySQL doesn't support functions as default values. Try using a trigger.
MySQL doesn't support tables with NESTED TABLE columns. Revise any tables with NESTED TABLE columns to avoid these columns.
MySQL doesn't support the objects column. Create a user-defined function.
CREATE INDEX
CREATE INDEX statements are converted automatically except that MySQL does not support bitmap, function-based, or domain indexes.
CREATE TRIGGER
CREATE TRIGGER statements are converted automatically except for the following.
Clause
COMPOUND
INSTEAD OF
Automatically converted
Details
No
No
No
MySQL doesn't support compound triggers. Create a single trigger for each part of the compound trigger.
MySQL doesn't support INSTEAD OF. Try using a BEFORE trigger.
MySQL doesn’t support conditional predicates.
INSERTING | UPDATING |
DELETING without FOR EACH ROW No
FOLLOWS | PRECEDES
UPDATE OF
REFERENCING NEW AS |
OLD AS
WHEN(condition)
No
No
No
No
MySQL doesn't support statement triggers. Try including
FOR EACH ROW.
MySQL doesn't support the FOLLOWS | PRECEDES clause.
Try using a FOR EACH ROW trigger.
MySQL doesn't support the UPDATE OF clause. Try using a FOR EACH ROW trigger.
MySQL doesn't support the REFERENCING clauses. Modify references to pseudorows to use OLD and NEW instead.
MySQL doesn't support WHEN(condition) triggers. Apply the condition for WHEN in the trigger body.
ON NESTED TABLE No
Version 1.0
263
AWS Schema Conversion Tool User Guide
Data Definition Language (DDL)
Clause
trigger-status=DISABLED create-date modify-date status description
Automatically converted
Details
No
No
MySQL doesn't support the DISABLED clause. Drop the trigger instead.
MySQL doesn't support create-date for triggers. Try using a FOR EACH ROW trigger.
No
No
No
MySQL doesn't support modify-date for triggers. Try using a FOR EACH ROW trigger.
MySQL doesn't support trigger status values. Try using a
FOR EACH ROW trigger.
MySQL doesn't support descriptions for triggers.
In MySQL, you can get a trigger description using
INFORMATION_SCHEMA.TRIGGERS. MySQL doesn't support the REFERENCING clause. The following are the corresponding values between Oracle(USER_TRIGGERS) and MySQL(INFORMATION_SCHEMA.TRIGGERS):
• TABLE_OWNER corresponds to TRIGGER_SCHEMA
• TRIGGER_NAME corresponds to TRIGGER_NAME
• TRIGGER_TYPE corresponds to ACTION_TIMING
• TRIGGERING_EVENT corresponds to
EVENT_MANIPULATION
• TABLE_NAME corresponds to EVENT_OBJECT_TABLE
• REFERENCING_NAMES corresponds to
ACTION_REFERENCE_NEW_ROW(always is NEW),
ACTION_REFERENCE_OLD_ROW(always is OLD) triggeringevent=ddl_events triggeringevent=database_events
No
No base-object-type=VIEW No base-object-type=SCHEMA No
No base-objecttype=DATABASE action-type=CALL or PL/
SQL
No
No crossedition=FORWARD/
REVERSE fire-once=YES apply-server-only=YES
No
No
Version 1.0
264
AWS Schema Conversion Tool User Guide
Data Definition Language (DDL)
Clause
referencingnames=PARENT
Automatically converted
Details
No
CREATE VIEW
CREATE VIEW statements are converted automatically except for the following.
Clause
FORCE
NOFORCE
WITH READ ONLY create-date modify-date status oid-text view-type-owner view-type superview-name editioning-view encrypted-view
CAST
No
No
No
No
No
No
No
No
No
No
No
Automatically converted
Details
No
No NOFORCE is the default behavior for MySQL. You don't need to specify this option.
MySQL doesn’t support views with nested table columns.
CREATE CONSTRAINT
CREATE CONSTRAINT statements are converted automatically except for the following.
Clause Automatically converted
Details
DISABLE, status=DISABLED No
Foreign keys of different types constraint-type
No
No
My SQL doesn't support constraints with the status
DISABLE. Drop the constraint.
MySQL doesn't support foreign keys with different types of columns and referenced columns. Modify the column types using an equivalent of the column data types in the original database.
MySQL doesn't support the constraint check option on a view. Try using a trigger.
Version 1.0
265
AWS Schema Conversion Tool User Guide
Cursors
CREATE SEQUENCE
MySQL doesn't support sequences. Try developing a system for sequences in your application.
Cursors
Cursors are converted automatically except for the following.
Clause
SQLAttribute
REF CURSOR
SYS_REFCURSOR
CURSOR
REF_CURSOR variable
Automatically converted
Details
Partial
No
MySQL doesn't support the cursor attribute
SQL%ISOPEN
MySQL doesn't support the cursor attribute
SQL
%BULK_ROWCOUNT
. To calculate processed rows, use a variable.
MySQL doesn't support the REF CURSOR object. Perform a manual conversion.
No
Partial
Partial
MySQL doesn't support a variable of SYS_REFCURSOR type. Perform a manual conversion.
The AWS Schema Conversion Tool cannot automatically transform the SELECT statement for an implicit cursor.
Try rewriting the SELECT statement.
The SELECT statement for the REF_CURSOR variable cannot be transformed. Try rewriting the SELECT statement.
Hints
MySQL doesn't support hints. Try using MySQL performance tuning methods or perform a manual conversion.
Clause
/*+ ALL_ROWS */
/*+ AND_EQUAL(table index...) */
/*+ APPEND */
/*+ CACHE(table) */
No
No
/*+ CHOOSE */
/*+ CLUSTER(table) */
/*+
CURSOR_SHARING_EXACT
*/
/*+ DRIVING_SITE(table) */ No
No
No
No
Automatically converted
Details
No
No
Version 1.0
266
AWS Schema Conversion Tool User Guide
Hints
Clause Automatically converted
Details
/*+ DYNAMIC_SAMPLING */ No
No /*+
EXPAND_GSET_TO_UNION
*/
/*+ FACT(table) */
/*+ FIRST_ROWS(n) */
No
No
/*+ FULL(table) */
/*+ HASH */
/*+ HASH_SJ */
/*+ INDEX(table index) */
/*+ INDEX_ASC(table index)
*/
/*+ INDEX_COMBINE(table index) */
No
No
No
No
No
No
/*+ INDEX_DESC(table index) */
/*+ INDEX_FFS(table index)
*/
/*+ LEADING(table) */
No
No
/*+ MERGE(table) */
/*+ MERGE_SJ */
/*+ NL_SJ */
/*+ NO_EXPAND */
/*+ NO_INDEX(table index)
*/
No
No
/*+ NO_MERGE(table) */ No
/*+ NO_PARALLEL(table) */ No
No /*+
NO_PARALLEL_INDEX(table index) */
/*+
NO_PUSH_PRED(subquery)
*/
/*+
NO_PUSH_SUBQ(subquery)
*/
No
No
No
No
No
No
Version 1.0
267
AWS Schema Conversion Tool User Guide
Hints
Clause
/*+ NO_REWRITE */
/*+ NO_UNNEST */
/*+ NOAPPEND */
/*+ NOCACHE(table) */
/*+ NOFACT(table) */
/*+ ORDERED */
/*+ ORDERED_PREDICATES
*/
/*+ PARALLEL(table server_num) */
/*+ PARALLEL_INDEX(table index server_num) */
/*+ PQ_DISTRIBUTE(table out_distr in_distr) */
/*+ PUSH_PRED(subquery)
*/
/*+ PUSH_SUBQ(subquery)
*/
/*+ REWRITE */
/*+ ROWID(table) */
/*+ RULE */
/*+ STAR */
/*+
STAR_TRANSFORMATION
*/
/*+ UNNEST */
/*+ USE_CONCAT */
/*+ USE_HASH(table1 table2) */
/*+ USE_MERGE(table1 table2) */
No
No
No
No
No
No
Automatically converted
Details
No
No
No
No
No
No
No
No
No
No
No
No
No
No
No
Version 1.0
268
AWS Schema Conversion Tool User Guide
Exceptions
Exceptions
Item
RAISE
%s
EXCEPTION
PRAGMA EXCEPTION_INIT
Automatically converted
Details
No
No
No
No
MySQL doesn't support the RAISE command. Review the exception, and if possible convert it to an exception using the SIGNAL or RESIGNAL statement.
MySQL doesn't support the %s exception. Review the exception, and if possible convert it to an exception using the SIGNAL or RESIGNAL statement.
MySQL doesn't support the EXCEPTION declaration. Use the DECLARE ... CONDITION statement.
MySQL doesn't support the PRAGMA EXCEPTION_INIT declaration. Use the DECLARE ... CONDITION statement.
MySQL doesn't support the
PROC_RAISE_APPLICATION_ERROR statement. Use the
DECLARE ... CONDITION statement. Try using the SIGNAL or RESIGNAL statement.
Built-In Exceptions
Exception
INVALID_NUMBER
TIMEOUT_ON_RESOURCE No
TRANSACTION_BACKED_OUT No
INVALID_CURSOR No
Automatically converted
Details
No Try creating a user exception.
Try creating a user exception.
Try creating a user exception.
You can use one of several handlers for invalid cursors.
Choose the correct handler based on the issue.
Try creating a user exception.
NOT_LOGGED_ON
LOGIN_DENIED
STORAGE_ERROR
PROGRAM_ERROR
No
No
No
No
Try creating a user exception.
You can use one of several handlers for invalid cursors.
Choose the correct handler based on the issue.
Try using the handler "1815 - Internal Error."
Related Topics
•
What Is the AWS Schema Conversion Tool? (p. 1)
•
Getting Started with the AWS Schema Conversion Tool (p. 11)
•
Installing and Updating the AWS Schema Conversion Tool (p. 6)
Version 1.0
269
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Supported Schema Conversion
Oracle to PostgreSQL Supported Schema
Conversion
The following sections list the schema elements from an Oracle database and whether they are supported for automatic conversion to PostgreSQL using the AWS Schema Conversion Tool.
DDL
Statements
Clause
ALTER CLUSTER
ALTER DATABASE
ALTER DIMENSION
ALTER DISKGROUP
ALTER FLASHBACK
ARCHIVE
ALTER FUNCTION
ALTER TABLESPACE
CREATE [OR REPLACE]
FUNCTION
CREATE [TEMPORARY]
TABLESPACE
CREATE CLUSTER
CREATE CONTEXT
CREATE CONTROLFILE
CREATE DATABASE
CREATE DATABASE LINK
CREATE DIMENSION
CREATE DIRECTORY
CREATE DISKGROUP
CREATE FLASHBACK
ARCHIVE
DROP CLUSTER
DROP DATABASE
DROP DATABASE LINK
Yes
No
No
No
No
No
No
No
No
No
No
No
No
No
Yes
No
No
No
No
Automatically
Converted
Details
No
No
Version 1.0
270
AWS Schema Conversion Tool User Guide
DDL
Clause
DROP DIMENSION
DROP DIRECTORY
DROP DISKGROUP
DROP FLASHBACK
ARCHIVE
DROP FUNCTION
DROP TABLE
DROP TABLESPACE
DROP VIEW
No
No
No
Yes
No
No
No
Automatically
Converted
Details
No
ALTER TABLE
Clause
ADD CONSTRAINT
ADD column
DEALLOCATE UNUSED
DISCARD/IMPORT
TABLESPACE
DROP CONSTRAINT
ENABLE/DISABLE constraint
ENABLE/DISABLE triggers
MODIFY
MODIFY COLUMN
PARTITION operations
REMOVE PARTITIONING
RENAME
RENAME COLUMN
No
No
No
Automatically
Converted
Details
Yes
No
No
No
No
No
No
No
No
No
CREATE [OR REPLACE] VIEW Statement
Clause
FORCE
Automatically
Converted
Details
Yes
Version 1.0
271
AWS Schema Conversion Tool User Guide
DDL
Clause
NOFORCE
READ ONLY
Updatable Views
WITH OBJECT IDENTIFIER
Automatically
Converted
Details
Yes
Yes
Yes
Yes
CREATE INDEX Statement
Clause
BITMAP
DOMAIN
Automatically
Converted
Details
No
No
Issue 5206: PostgreSQL doesn't support bitmap indexes (p. 312)
Issue 5208: PostgreSQL doesn't support domain indexes (p. 312)
FUNCTION-BASED BITMAP No
Yes
Issue 5206: PostgreSQL doesn't support bitmap indexes (p. 312)
Issue 5555: PostgreSQL doesn't support functional indexes that aren't single-column (p. 312)
FUNCTION-BASED
NORMAL
NONUNIQUE
NORMAL
UNIQUE
Yes
Yes
Yes
CREATE TABLE
Clause
Clustered tables
External table
Function as default value for column
Object table
Partitioned table
Regular tables
Temporary tables
Automatically
Converted
Details
No
No
Issue 5199: PostgreSQL doesn't support CLUSTERED
Issue 5200: PostgreSQL doesn't support EXTERNAL
Yes
No
No
Issue 5196: PostgreSQL doesn't support OBJECT
Issue 5201: PostgreSQL doesn't support all partition types (p. 313)
Yes
Partial
Issue 5198: PostgreSQL doesn't support GLOBAL
Version 1.0
272
AWS Schema Conversion Tool User Guide
DML
Sequences
Clause
CREATE
Using
Automatically
Converted
Details
Yes
Yes
DML
Built-in SQL Functions
Aggregate Functions
Clause
AVG
COLLECT
CORR
CORR_*
COUNT
COVAR_POP
COVAR_SAMP
CUME_DIST
DENSE_RANK
FIRST
GROUP_ID
GROUPING
GROUPING_ID
LAST
Automatically
Converted
Details
Yes
No
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Yes
No
No
No
No
No
No
No
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Version 1.0
273
AWS Schema Conversion Tool User Guide
DML
Clause
MAX
MEDIAN
MIN
PERCENT_RANK
PERCENTILE_CONT
PERCENTILE_DISC
RANK
REGR_ (Linear Regression)
Functions
STATS_BINOMIAL_TEST
STATS_CROSSTAB
STATS_F_TEST
STATS_KS_TEST
STATS_MODE
STATS_MW_TEST
STATS_ONE_WAY_ANOVA
STATS_T_TEST_*
STATS_WSR_TEST
STDDEV
STDDEV_POP
STDDEV_SAMP
Automatically
Converted
Details
Yes
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
No
No
No
No
No
No
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
No
No
No
No
No
No
No
No
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Version 1.0
274
Clause
SUM
VAR_POP
VAR_SAMP
VARIANCE
AWS Schema Conversion Tool User Guide
DML
Automatically
Converted
Details
Yes
No
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Analytic Functions
Clause
AVG *
CORR *
COUNT *
COVAR_POP *
COVAR_SAMP *
CUME_DIST
DENSE_RANK
FIRST
FIRST_VALUE *
LAG
LAST
LAST_VALUE *
LEAD
MAX *
MIN *
NTILE
PERCENT_RANK
PERCENTILE_CONT
PERCENTILE_DISC
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Yes
Yes
Yes
No
Automatically
Converted
Details
Yes
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Yes
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Version 1.0
275
AWS Schema Conversion Tool User Guide
DML
Clause
RANK
RATIO_TO_REPORT
REGR_ (Linear Regression)
Functions *
ROW_NUMBER
STDDEV *
STDDEV_POP *
STDDEV_SAMP *
SUM *
VAR_POP *
VAR_SAMP *
VARIANCE *
Yes
Yes
Yes
Yes
No
Automatically
Converted
Details
Yes
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Yes
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Yes
Character Functions Returning Character Values
Clause
CHR(num)
CONCAT(char1, char2)
INITCAP(string)
LOWER(string)
LPAD(string, len)
LPAD(string, len, pad)
LTRIM(string)
NLS_INITCAP
NLS_LOWER
NLS_UPPER
NLSSORT
Yes
Yes
Yes
Yes
Automatically
Converted
Details
Yes
Yes
Yes
No
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Version 1.0
276
AWS Schema Conversion Tool User Guide
DML
Clause
REGEXP_REPLACE
REGEXP_SUBSTR
REPLACE(str, search)
REPLACE(str, search, replace)
RPAD(string, len)
RTRIM(string)
RTRIM(string, set)
SOUNDEX(string)
SUBSTR(string, pos, len)
TRANSLATE(string, from, to)
TREAT
TRIM([type trim FROM] string)
UPPER(string)
Yes
Yes
Yes
Yes
Yes
Yes
Automatically
Converted
Details
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Yes
Yes
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Yes
Yes
Character Functions Returning Number Values
Clause
ASCII(str)
INSTR(str, substr)
INSTR(str, substr, pos)
Automatically
Converted
Details
Yes
Yes
Implemented in Extension
Library
INSTR(str, substr, pos, num) Implemented in Extension
Library
LENGTH(string)
REGEXP_INSTR
Yes
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Version 1.0
277
AWS Schema Conversion Tool User Guide
DML
Collection Functions
Clause
CARDINALITY
COLLECT
SET
Automatically
Converted
Details
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Conversion Functions
Clause
ASCIISTR(string)
BIN_TO_NUM(bit1, bit2, …) Yes
CAST Yes
CHARTOROWID No
Automatically
Converted
Details
Implemented in Extension
Library
COMPOSE
CONVERT(string, charset)
DECOMPOSE
No
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
HEXTORAW
NUMTODSINTERVAL
Yes
No
NUMTOYMINTERVAL No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
RAWTOHEX
RAWTONHEX
Yes
Yes
ROWIDTOCHAR
ROWIDTONCHAR
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
SCN_TO_TIMESTAMP
TIMESTAMP_TO_SCN
Yes
Yes
Version 1.0
278
AWS Schema Conversion Tool User Guide
DML
Clause
TO_BINARY_DOUBLE
TO_BINARY_FLOAT
TO_CHAR (character)
Yes
Yes
TO_CHAR (datetime, format)
Yes
TO_CHAR (number, format) Implemented in Extension
Library
TO_CLOB
TO_DATE
Automatically
Converted
Details
Yes
TO_DSINTERVAL
TO_LOB
TO_MULTI_BYTE
TO_NCHAR (character)
TO_NCHAR (datetime)
Yes
Yes
Yes
Yes
Implemented in Extension
Library
Yes
TO_NCHAR (number)
TO_NCLOB
TO_NUMBER
TO_SINGLE_BYTE
TRANSLATE ... USING
UNISTR
Implemented in Extension
Library
Implemented in Extension
Library
Implemented in Extension
Library
Implemented in Extension
Library
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Implemented in Extension
Library
Version 1.0
279
AWS Schema Conversion Tool User Guide
DML
Data Mining Functions
Clause
CLUSTER_ID
CLUSTER_PROBABILITY
CLUSTER_SET
FEATURE_ID
FEATURE_SET
FEATURE_VALUE
PREDICTION
PREDICTION_COST
PREDICTION_DETAILS
PREDICTION_PROBABILITY
PREDICTION_SET
Automatically
Converted
Details
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
No
No
No
No
No
No
No
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Datetime Functions
Clause Automatically
Converted
Details
ADD_MONTHS(date, num) Implemented in Extension
Library
CURRENT_DATE
CURRENT_TIMESTAMP
DBTIMEZONE
Yes
Yes
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
EXTRACT(DAY FROM date) Yes
EXTRACT(HOUR FROM time)
Yes
Version 1.0
280
AWS Schema Conversion Tool User Guide
DML
Clause Automatically
Converted
Details
Yes EXTRACT(MINUTE FROM time)
EXTRACT(MONTH FROM date)
Yes
EXTRACT(SECOND FROM time)
Yes
EXTRACT(YEAR FROM date) Yes
FROM_TZ Implemented in Extension
Library
LAST_DAY(date)
LOCALTIMESTAMP
LOCALTIMESTAMP([prec])
MONTHS_BETWEEN(date1, date2)
NEW_TIME
Implemented in Extension
Library
Yes
Yes
Yes
NEXT_DAY
NUMTODSINTERVAL
NUMTOYMINTERVAL
ROUND (date)
No
Implemented in Extension
Library
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
SESSIONTIMEZONE
SYS_EXTRACT_UTC
Yes
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
SYSDATE
SYSTIMESTAMP
TO_CHAR (datetime, format)
TO_DSINTERVAL
Yes
Yes
Yes
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Version 1.0
281
AWS Schema Conversion Tool User Guide
DML
Clause
TO_TIMESTAMP(exp)
TO_TIMESTAMP_TZ
TO_YMINTERVAL
TRUNC (datetime)
TZ_OFFSET
Automatically
Converted
Details
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
No
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
dbms_output
Clause
dbms_output.put() dbms_output.put_line()
Automatically
Converted
Details
Yes
Yes
Encoding and Decoding Functions
Clause Automatically
Converted
Details
Yes DECODE(exp, when, then,
…)
DUMP No
ORA_HASH
VSIZE
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Environment and Identifier Functions
Clause
SYS_CONTEXT
SYS_GUID
Automatically
Converted
Details
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Version 1.0
282
AWS Schema Conversion Tool User Guide
DML
Clause
SYS_TYPEID
UID
USER
USERENV('parameter')
Automatically
Converted
Details
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Yes
Yes
General Comparison Functions
Clause
GREATEST(exp, exp2, …)
LEAST(exp, exp2, …)
Automatically
Converted
Details
Yes
Yes
Hierarchical Functions
Clause
SYS_CONNECT_BY_PATH
Automatically
Converted
Details
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Large Object Functions
Clause
BFILENAME
EMPTY_BLOB,
EMPTY_CLOB
Automatically
Converted
Details
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Model Functions
Clause
CV
ITERATION_NUMBER
PRESENTNNV
Automatically
Converted
Details
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Version 1.0
283
AWS Schema Conversion Tool User Guide
DML
Clause
PRESENTV
PREVIOUS
Automatically
Converted
Details
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
NLS Character Functions
Clause
NLS_CHARSET_DECL_LEN
NLS_CHARSET_ID
NLS_CHARSET_NAME
Automatically
Converted
Details
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
NULL-Related Functions
Clause
COALESCE(exp1, exp2, …)
Automatically
Converted
Details
Yes
LNNVL No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
NULLIF(exp1, exp2)
NVL(exp, replacement)
NVL2(exp1, exp2, exp3)
Yes
Yes
Yes
Numeric Functions
Clause
ABS(num)
ACOS(num)
ASIN(num)
ATAN(num)
ATAN2(x,y)
BITAND(exp1, exp2)
CEIL(num)
Yes
Yes
Yes
Yes
Automatically
Converted
Details
Yes
Yes
Yes
Version 1.0
284
AWS Schema Conversion Tool User Guide
DML
Clause
COS(num)
COSH(num)
EXP(n)
FLOOR(num)
LN(num)
LOG(num1, num2)
MOD(dividend, divisor)
NANVL(n2, n1)
POWER(value, n)
REMAINDER(n1, n2)
ROUND (num, integer)
SIGN(exp)
SIN(num)
SINH(num)
SQRT(num)
TAN(num)
TANH(num)
TRUNC (number)
WIDTH_BUCKET
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Automatically
Converted
Details
Yes
Yes
Yes
Yes
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Object Reference Functions
Clause
DEREF
MAKE_REF
REF
REFTOHEX
Automatically
Converted
Details
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
No
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Version 1.0
285
Clause
VALUE
XML Functions
Clause
APPENDCHILDXML
DELETEXML
DEPTH
EXISTSNODE
EXTRACT (XML)
EXTRACTVALUE
INSERTCHILDXML
INSERTXMLBEFORE
PATH
SYS_DBURIGEN
SYS_XMLAGG
SYS_XMLGEN
UPDATEXML
XMLAGG
XMLCDATA
XMLCOLATTVAL
AWS Schema Conversion Tool User Guide
DML
Automatically
Converted
Details
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Automatically
Converted
Details
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
No
No
No
No
No
No
No
No
No
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Version 1.0
286
Clause
XMLCOMMENT
XMLCONCAT
XMLFOREST
XMLPARSE
XMLPI
XMLQUERY
XMLROOT
XMLSEQUENCE
XMLSERIALIZE
XMLTABLE
XMLTRANSFORM
Hints
Clause
Index and Cluster
Join Order
Joins
Optimizer Mode
Parallel Execution
Query Transformation
AWS Schema Conversion Tool User Guide
DML
Automatically
Converted
Details
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
No
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
No
No
No
No
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Issue 5340: PostgreSQL doesn't support the %s function (p. 311)
Automatically
Converted
Details
No
No
Issue 5103: PostgreSQL doesn't support the %s hint (p. 319)
Issue 5103: PostgreSQL doesn't support the %s hint (p. 319)
No
No
Issue 5103: PostgreSQL doesn't support the %s hint (p. 319)
Issue 5103: PostgreSQL doesn't support the %s hint (p. 319)
No
No
Issue 5103: PostgreSQL doesn't support the %s hint (p. 319)
Issue 5103: PostgreSQL doesn't support the %s hint (p. 319)
Version 1.0
287
AWS Schema Conversion Tool User Guide
DML
Clause
Other
Automatically
Converted
Details
No
Issue 5103: PostgreSQL doesn't support the %s hint (p. 319)
Joins
Clause
Cross Joins
Inner Joins
Outer Joins
Automatically
Converted
Details
Yes
Yes
Yes
Operators and Date Functions
Clause
Arithmetic operators
Concatenation operators
Automatically
Converted
Details
Yes
Yes
Predicates
Clause
Boolean conditions
Comparison conditions: '=,
<>, <, <=, >, >=, ANY, SOME,
ALL
Exists conditions
In conditions
Null conditions
Pattern matching conditions
Range conditions
Yes
Yes
Yes
Yes
Automatically
Converted
Details
Yes
Yes
Yes
Version 1.0
288
AWS Schema Conversion Tool User Guide
DML
Set operators
Concatenation operators
Clause
INTERSECT, EXCEPT
MINUS
UNION, UNION ALL
Automatically
Converted
Details
Yes
Yes
Yes
Statements
DELETE
Clause Automatically
Converted
Details
DELETE FROM
MATERIALIZED VIEW
No
DELETE FROM SUBQUERY No
Issue 5095: PostgreSQL doesn't support using a materialized VIEW (p. 318)
Issue 5068: PostgreSQL doesn't support the DELETE statement for a subquery (p. 316)
DELETE FROM TABLE
DELETE FROM VIEW
DELETE with Error Logging clause
DELETE with RETURNING clause
Yes
Yes
No
Yes
Issue 5067: PostgreSQL doesn't support the DELETE statement with the ERROR LOG option (p. 315)
HIERARCHICAL QUERY AND HIERARCHICAL QUERY PSEUDOCOLUMNS
Clause
CONNECT BY CLAUSE
CONNECT BY NOCYCLE
Automatically
Converted
Details
Yes
No
Issue 5586: Automatic conversion for queries with
NOCYCLE clause not supported (p. 320)
Yes CONNECT_BY_ISLEAF pseudocolumn
LEVEL PSEUDOCOLUMN
ORDER SIBLINGS BY
START WITH CLAUSE
SYS_CONNECT_BY_PATH
Yes
Yes
Yes
Yes
Version 1.0
289
AWS Schema Conversion Tool User Guide
DML
Hierarchical query operators
Clause
CONNECT_BY_ROOT
PRIOR
Automatically
Converted
Details
Yes
Yes
INSERT
Clause
ALL
DEFAULT
ELSE
FIRST
INSERT from clause
"SUBQUERY"
INSERT from clause
"VALUES(...)"
INSERT INTO SUBQUERY No
INSERT INTO TABLE
INSERT INTO VIEW
INSERT with partition_extension_clause
Inserting Into a Table with
Error Logging clause
RETURNING INTO
WHEN
Yes
Yes
No
No
Yes
Yes
Automatically
Converted
Details
Yes
Yes
Yes
Yes
Yes
Yes
Issue 5071: PostgreSQL doesn't support the INSERT statement for a subquery (p. 318)
Issue 5024: PostgreSQL doesn't support the INSERT statement with partition_extension_clause (p. 318)
Issue 5070: PostgreSQL doesn't support the INSERT statement with the ERROR LOG option (p. 318)
LOCK TABLE
Clause
Locking table in exclusive mode
Locking table in share mode
Locking without waiting
Automatically
Converted
Details
Yes
Yes
Yes
Version 1.0
290
AWS Schema Conversion Tool User Guide
DML
SELECT
Clause
Add or subtract operators
BULK COLLECT INTO
CUBE
FOR UPDATE
GROUP BY
GROUPING SETS
HAVING
INTERSECT
INTO
MINUS
MODEL
ORDER BY
PIVOT clause
ROLLUP
ROWNUM pseudocolumn
SELECT ALL
SELECT DISTINCT
SELECT LIST
SELECT UNIQUE
UNION
UNION ALL
UNPIVOT clause
WHERE( field_name1,
…,fieldnameN) IN
Yes
(subquery_with_multiple_fields)
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Automatically
Converted
Details
Yes
No
No
No
Issue 5140: PostgreSQL doesn't support BULK COLLECT
Issue 5557: PostgreSQL doesn't support GROUPING SETS,
CUBE, and ROLLUP functions (p. 321)
Issue 5139: PostgreSQL doesn't support FOR UPDATE
Yes
No
Issue 5557: PostgreSQL doesn't support GROUPING SETS,
CUBE, and ROLLUP functions (p. 321)
Issue 5126: PostgreSQL doesn't support the MODEL statement (p. 320)
Yes
No
No
Issue 5077: PostgreSQL doesn't support the PIVOT clause for the SELECT statement (p. 326)
Issue 5557: PostgreSQL doesn't support GROUPING SETS,
CUBE, and ROLLUP functions (p. 321)
Version 1.0
291
AWS Schema Conversion Tool User Guide
DML
Clause
WHERE comparison_condition
(=;<>;!
=;<;>;>=;<=;ANY;SOME;ALL)
Yes
WHERE Yes compound_condition_with_or_and_not
Yes WHERE field_name
BETWEEN arg1 AND arg2
WHERE field_name IN
(const1,...,constN)
Yes
WHERE field_name IN
(subquery)
WHERE like_condition
(operator LIKE)
Automatically
Converted
Details
Yes
Yes
WITH Yes
UPDATE
Clause
UPDATE (subquery)
UPDATE MATERIALIZED
VIEW
UPDATE TABLE
UPDATE VIEW
UPDATE with Error Logging clause
UPDATE with partition extension clause
UPDATE with RETURNING…
INTO clause
UPDATE with subqueries into SET-clause
UPDATE-operator which based on data from others tables
Yes
Yes
No
No
Yes
Yes
Yes
Automatically
Converted
Details
No
Issue 5065: PostgreSQL doesn't support the UPDATE statement for a subquery (p. 325)
No
Issue 5095: PostgreSQL doesn't support using a materialized VIEW (p. 318)
Issue 5064: PostgreSQL doesn't support the UPDATE statement with the ERROR LOG option (p. 325)
Issue 5558: PostgreSQL doesn't support the UPDATE statement for a PARTITION (p. 325)
Version 1.0
292
AWS Schema Conversion Tool User Guide
PLSQL
Clause
MERGE
TRUNCATE TABLE
Automatically
Converted
Details
No
Issue 5102: PostgreSQL doesn't support the MERGE statement (p. 319)
Yes
PLSQL
Arguments of functions and procedures
Clause Automatically
Converted
Details
Yes Built-in datatype scalar arguments
Cursor-type arguments
Default clause in declaration of arguments
IN, OUT, IN OUT type of arguments
Yes
Yes
Yes
Ref cursor-type arguments Yes
UDT collection-type arguments
Yes
UDT object-type arguments Yes
UDT record-type Yes
Functions
Clause
Functions with DML
Functions without DML
Return pipelined table
Return ref cursor
Return scalar
Return table
Yes
Yes
Return UDT collection-type Yes
Return UDT object-type Yes
Automatically
Converted
Details
Yes
Yes
Yes
Yes
Version 1.0
293
AWS Schema Conversion Tool User Guide
PLSQL
Clause
Return UDT record-type
Packages
Automatically
Converted
Details
Yes
Clause
Global cursor declaration
Global user exception declaration
Initialization block BEGIN
… END in packages
Package functions
Package procedures
Package variables
User type declaration
Yes
Yes
Yes
Yes
Automatically
Converted
Details
No
No
Yes
PL SQL constructions
Clause
block EXCEPTION when exception_name then…
CASE_NOT_FOUND case when conditions then…else… end case; close cursor_variable
COMMIT
CURSOR_ALREADY_OPEN
DUP_VAL_ON_INDEX execute immediate
SQL_string_variable into variables_list use variables_list fetch cursor_variable into variables_list
Automatically
Converted
Details
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
Issue 5334: PostgreSQL doesn't support the dynamic SQL statement (p. 316)
Version 1.0
294
AWS Schema Conversion Tool User Guide
PLSQL
Clause
FORALL -cycle for I in(begN..endN) loop… end loop for I in(cursor_name) loop… end loop for I in(select_statement) loop… end loop
FOR i IN REVERSE begN..endN LOOP… END
LOOP; goto label;
Yes
Yes
Yes
No
Automatically
Converted
Details
No
Issue 5121: PostgreSQL doesn't support the FORALL statement (p. 324)
Yes
Issue 5335: PostgreSQL doesn't support the GOTO operator (p. 321)
if conditions then…else if conditions then… end if;
Yes if conditions then… end if; Yes
INVALID_CURSOR Yes
INVALID_NUMBER
LOGIN_DENIED
LOOP…exit when conditions; END LOOP;
NO_DATA_FOUND
NOT_LOGGED_ON
Yes
Yes
Yes
Yes
Yes
NULL Statement open cursor_variable
Yes
Yes open cursor_variable for Yes select_statemet_string_variable others Yes
PRAGMA No
AUTONOMOUS_TRANSACTION
START TRANSACTION, COMMIT, or ROLLBACK (p. 318)
PROGRAM_ERROR Yes raise_application_error(exept_code, message)
Yes raise exeption_name Yes
ROLLBACK Yes
Version 1.0
295
AWS Schema Conversion Tool User Guide
PLSQL
Clause
select…bulk collect into table_variable from table_name
SQL%BULK_ROWCOUNT
SQL%FOUND
SQL%ISOPEN
SQL%NOTFOUND
SQL%ROWCOUNT
STORAGE_ERROR
TIMEOUT_ON_RESOURCE
TOO_MANY_ROWS Yes
TRANSACTION_BACKED_OUT Yes
VALUE_ERROR Yes while conditions loop… end loop;
ZERO_DIVIDE
Yes
Yes
Yes
Yes
Yes
Yes
No
Yes
No
Automatically
Converted
Details
No
Issue 5140: PostgreSQL doesn't support BULK COLLECT
Issue 5084: PostgreSQL doesn't support the cursor attribute %ISOPEN (p. 315)
PL SQL declaration block
Clause Automatically
Converted
Details
Declare built-in scalar variable
Yes
Declare ref-cursor variable Yes
Declare static cursor
Declare UDT collection variable
Yes
Yes
Declare UDT object variable Yes
Declare UDT record variable Yes
Declare UDT array types Yes
Declare user-exception
Declare with %rowtype option
Yes
Yes
Version 1.0
296
AWS Schema Conversion Tool User Guide
Data Types
Clause Automatically
Converted
Details
Declare with %type option Yes
Procedures
Clause
CREATE PROCEDURE statement
Automatically
Converted
Details
Yes
Triggers
Clause
BEFORE, AFTER - options
FOR EACH ROW -option
INSTEAD OF - options
NESTED TABLE - clause
REFERENCING - clause
Statement-trigger trigger on TABLE
Trigger on VIEW
WHEN(condition)- option
Yes
Yes
No
Automatically
Converted
Details
Yes
Yes
Yes
No
No
Issue 5240: PostgreSQL doesn't support triggers on nested table columns in views (p. 323)
Issue 5238: PostgreSQL doesn't support the
No
Data Types
Data type
BFILE
BINARY_FLOAT
BINARY_DOUBLE
BLOB
CHAR(n)
Automatically
Converted to
character varying real double precision bytea character
Details
Issue 5212: PostgreSQL doesn't have a data type
Version 1.0
297
Data type
CHARACTER(n)
CLOB
DATE
DECIMAL(p,s)
DEC(p,s)
FLOAT
INTEGER
INT
INTERVAL YEAR(p) TO
MONTH
INTERVAL DAY(p) TO
SECOND(s)
LONG
LONG RAW
NCHAR(n)
NCHAR VARYING(n)
NCLOB
NUMBER(p)
NUMBER(p,0)
NUMBER(*,0)
NUMBER(p,s)
NUMBER(*)
NUMBER
NVARCHAR2(n)
RAW(n)
ROWID
AWS Schema Conversion Tool User Guide
Data Types bytea character character varying text numeric numeric numeric numeric double precision double precision character varying bytea character
Automatically
Converted to
character
Details
text timestamp(0) without time zone numeric numeric double precision numeric numeric interval year to month interval day to second(s) text
Issue 5550: PostgreSQL doesn't have a data type
Version 1.0
298
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Data type
TIMESTAMP(p)
TIMESTAMP(p)
TIMESTAMP(p) WITH TIME
ZONE
TIMESTAMP(p) WITH TIME
ZONE
TIMESTAMP(p) WITH
LOCAL TIME ZONE
TIMESTAMP(p) WITH
LOCAL TIME ZONE
UROWID
VARCHAR
VARCHAR2
XMLTYPE timestamp(6) with time zone timestamp(p) without time zone timestamp(6) without time zone character varying character varying character varying xml
Automatically
Converted to
timestamp(p) without time zone timestamp(6) without time zone timestamp(p) with time zone
Details
Issue 5551: PostgreSQL doesn't have a data type
Oracle to PostgreSQL Conversion Reference
Use the following sections to get information on the types of issues you might encounter during an
Oracle to PostgreSQL conversion. Choose the link in the Issue column to get more detailed resolution information about the issue if it is available.
Build_in_services
Item
UTL_SMTP
DBMS_JOB
Issue
Issue 5590: The function was converted as procedure (p. 310)
Resolution
Can't return a reply because this functionality is asynchronous.
Version 1.0
299
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Built-In SQL Functions
Item
DateTime function
Issue
Issue 5584: The function %s depends on the time zone setting (p. 311)
FUNCTION
GREATEST(exp, exp2, ...)
LEAST(exp, exp2, ...)
Issue 5340: PostgreSQL doesn't support the
Issue 5272: The Oracle LEAST function and
PostgreSQL LEAST function might give different results (p. 311)
TO_CHAR, TO_DATE,
TO_NUMBER
Issue 5579: The second parameter of %s function can be processed incorrectly (p. 311)
Resolution
Review the transformed code, and set time zone manually if necessary.
Use suitable function or create user defined function.
Review your transformed code and modify it if necessary. Change an argument's type if necessary.
Review your transformed code and modify it if necessary. Change an argument's type if necessary.
Check converted code and make manual corrections if it's necessary.
CREATE
Item
Encrypted Objects
Issue
Issue 5099: Unable convert object due to %s not created (p. 311)
Issue 5332: The object has references on the object in %s schema (p. 311)
Issue 5582: Encrypted Objects (p. 312)
Resolution
Review the %s object.
Convert the object in %s schema also.
Decrypt the object before conversion.
CREATE CONSTRAINT
Item
status=DISABLED
Issue
Issue 5326: PostgreSQL doesn't support constraints with the status
CREATE INDEX
Item
Creating a Domain
Index
Issue
Issue 5208: PostgreSQL doesn't support domain indexes (p. 312)
Resolution
Drop the constraint.
Resolution
Revise your code and try to use simple index.
Version 1.0
300
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Item
Creating a Function-
Based Index
Creating an BITMAP
Index
Issue
Issue 5555: PostgreSQL doesn't support functional indexes that aren't singlecolumn (p. 312)
Issue 5206: PostgreSQL doesn't support bitmap indexes (p. 312)
Resolution
Revise your code and try to use simple index.
Revise your code and try to use simple index.
CREATE TABLE
Item
BFILE Data Type
CREATING A
PARTITIONED TABLE
Issue
Issue 5212: PostgreSQL doesn't have a data type BFILE (p. 312)
Issue 5201: PostgreSQL doesn't support all partition types (p. 313)
Resolution
Either store a named file with the data and create a routine that gets that file from the file system, or store the data blob inside your database.
Perform a manual conversion for the partition types that aren't supported.
Try using a table with triggers.
Try using a table.
CREATING
CLUSTERED TABLE
CREATING EXTERNAL
TABLES
CREATING GLOBAL
TEMPORARY TABLE
CREATING OBJECT
TABLES
Issue 5199: PostgreSQL doesn't support
Issue 5200: PostgreSQL doesn't support
Issue 5198: PostgreSQL doesn't support
GLOBAL TEMPORARY TABLE (p. 313)
Issue 5196: PostgreSQL doesn't support
Index-organized table
Issue 5581: PostgreSQL doesn't support index-organized table (p. 313)
NESTED TABLE
ROWID data type
Issue 5348: PostgreSQL doesn't support
Issue 5550: PostgreSQL doesn't have a data type ROWID (p. 313)
TABLE WITH VIRTUAL
COLUMNS
TIMESTAMP(n>6)
Data Type
TIMESTAMP(n>6)
WITH TIME ZONE data type
Issue 5554: PostgreSQL doesn't support virtual columns (p. 313)
Issue 5213: PostgreSQL expands fractional seconds support for TIME, DATETIME, and
TIMESTAMP values, with up to microseconds
(6 digits) of precision (p. 314)
Issue 5552: PostgreSQL expands fractional seconds support for TIME, DATETIME, and
TIMESTAMP values, with up to microseconds
(6 digits) of precision (p. 314)
Try using a local temporary table.
Revise your code to avoid
OBJECT TABLE.
Revise your architecture with a custom solution for the table type.
Revise your code to avoid
NESTED TABLE.
Review your transformed code and modify it if necessary.
They were emulated by a trigger.
Review your transformed code and modify it if necessary to avoid a loss of accuracy.
Review your transformed code and modify it if necessary to avoid a loss of accuracy.
Version 1.0
301
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Item
TIMESTAMP(n>6)
WITH LOCAL TIME
ZONE data type
UROWID data type
Issue
Issue 5553: PostgreSQL expands fractional seconds support for TIME, DATETIME, and
TIMESTAMP values, with up to microseconds
(6 digits) of precision (p. 314)
Issue 5551: PostgreSQL doesn't have a data type UROWID (p. 314)
Resolution
Review your transformed code and modify it if necessary to avoid a loss of accuracy.
Review your transformed code and modify it if necessary.
CREATE TYPE
Item
OBJECT TYPE
Issue
Issue 5572: PostgreSQL doesn't support object type methods (p. 315)
Resolution
Revise your architecture with a custom solution for the user type.
CURSOR
Item
Cursor attributes
TYPE .. IS REF
CURSOR
PARTITION
Issue
Issue 5084: PostgreSQL doesn't support the cursor attribute %ISOPEN (p. 315)
Issue 5226: PostgreSQL doesn't support
TYPE ... IS REF CURSOR (p. 315)
Resolution
Revise how you are using this attribute in your code.
Change the function to a stored procedure, and try using a table to store results.
Datetime Expressions
Item
at local at time zone
Issue
Resolution
Check, if the data violates these restrictions. If so, perform a manual migration.
DELETE
Item
ERROR LOG
Issue
Issue 5067: PostgreSQL doesn't support the DELETE statement with the ERROR LOG option (p. 315)
Issue 5098: PostgreSQL doesn't support the
DELETE statement for a PARTITION (p. 316)
Version 1.0
302
Resolution
You can add error records by inserting them into the log in the exception block.
Iterate through the errors in the exception block, add them to the log, and use the EXIT command when finished.
Either insert data into the overlying partition, or
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Item
QUERY
Issue
Issue 5068: PostgreSQL doesn't support the
DELETE statement for a subquery (p. 316)
Resolution
perform a manual conversion using the DELETE statement.
Perform this operation on the underlying tables instead.
DYNAMIC SQL
Item
BULK COLLECT
Issue
Issue 5088: PostgreSQL doesn't support the
EXECUTE IMMEDIATE statement with BULK
EXECUTE IMMEDIATE
Issue 5334: PostgreSQL doesn't support the dynamic SQL statement (p. 316)
RETURNING BULK
COLLECT INTO
Issue 5087: PostgreSQL doesn't support the RETURNING BULK COLLECT INTO clause (p. 316)
Resolution
Perform a manual conversion.
Review and modify the execution string.
Perform a manual conversion.
EXCEPTION
Item Issue
ACCESS_INTO_NULL
Issue 5561: PostgreSQL doesn't support the
ACCESS_INTO_NULL exception (p. 316)
COLLECTION_IS_NULL
EMPTY_BLOCK
EXCEPTION
NO_DATA_NEEDED
PROGRAM_ERROR
ROWTYPE_MISMATCH
Issue 5562: PostgreSQL doesn't support the
COLLECTION_IS_NULL exception (p. 316)
Issue 5580: The exception block was emptied after conversion (p. 316)
Issue 5570: PostgreSQL doesn't support exception name declaration (p. 317)
Issue 5563: PostgreSQL doesn't support the
NO_DATA_NEEDED exception (p. 317)
Issue 5560: PostgreSQL doesn't support the
PROGRAM_ERROR exception (p. 317)
Issue 5564: PostgreSQL doesn't support the
ROWTYPE_MISMATCH exception (p. 317)
Resolution
Review the exception used, and if possible convert it to another condition.
Review the exception used, and if possible convert it to another condition.
Check converted code and make manual corrections if it is necessary.
Review the exception used, and if possible convert it to another condition.
Review the exception used, and if possible convert it to another condition.
Review the exception used, and if possible convert it to another condition.
Review the exception used, and if possible convert it to another condition.
Version 1.0
303
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Item
SELF_IS_NULL
Issue
Issue 5565: PostgreSQL doesn't support the
SELF_IS_NULL exception (p. 317)
Issue 5566: PostgreSQL doesn't support the SUBSCRIPT_BEYOND_COUNT exception (p. 317)
Issue 5567: PostgreSQL doesn't support the SUBSCRIPT_OUTSIDE_LIMIT exception (p. 317)
SYS_INVALID_ROWID
Issue 5568: PostgreSQL doesn't support the
SYS_INVALID_ROWID exception (p. 317)
Resolution
Review the exception used, and if possible convert it to another condition.
Review the exception used, and if possible convert it to another condition.
Review the exception used, and if possible convert it to another condition.
Review the exception used, and if possible convert it to another condition.
EXPLICIT CURSORS
Item
RETURN
Issue
Issue 5559: PostgreSQL doesn't support the
RETURN TYPE for the cursor (p. 317)
Resolution
Use cursor declaration without this statement.
FUNCTION
Item
FUNCTIONS WITH
DML (START
TRANSACTION,
COMMIT, or
ROLLBACK.)
Issue
Resolution
Revise you code to implement a transaction control at application side.
INSERT
Item
ERROR LOG
Issue
Issue 5070: PostgreSQL doesn't support the INSERT statement with the ERROR LOG option (p. 318)
INSERT with
Issue 5024: PostgreSQL doesn't support the INSERT statement with partition_extension_clause (p. 318)
QUERY
Issue 5071: PostgreSQL doesn't support the
INSERT statement for a subquery (p. 318)
Version 1.0
304
Resolution
You can add error records by inserting them into the log in the exception block.
Iterate through the errors in the exception block, add them to the log, and use the EXIT command when finished.
Perform a manual conversion for the partition types that aren't supported.
Perform this operation on the underlying tables instead.
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Item
SUBPARTITION
Issue
Issue 5090: PostgreSQL doesn't support the INSERT statement for a
Resolution
Either insert data into the overlying partition, or perform a manual conversion using the INSERT statement.
MATERIALIZED VIEW
Item
CREATE
Issue
Issue 5094: PostgreSQL doesn't support a materialized VIEW (p. 318)
USING MATERIALIZED
VIEW
Issue 5095: PostgreSQL doesn't support using a materialized VIEW (p. 318)
Resolution
Revise your code to replace materialized VIEW with another solution.
Revise your code to replace materialized VIEW with another solution.
MERGE
Item
MERGE
Issue
Issue 5102: PostgreSQL doesn't support the
Resolution
To achieve the effect of a MERGE statement, use separate INSERT, DELETE, and
UPDATE statements.
Optimizer Hints
Item
HINT
Issue
Issue 5103: PostgreSQL doesn't support the
Resolution
Use PostgreSQL methods for performance tuning.
PACKAGES
Item Issue
Package global cursor
Issue 5330: PostgreSQL doesn't support global cursors (p. 319)
Package global user
EXCEPTION
Package user type declaration
Issue 5331: PostgreSQL doesn't support a global user exception (p. 319)
Resolution
Use another method for this functionality.
Use another method for this functionality.
Revise your architecture with a custom solution for the user type.
Version 1.0
305
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Parser Error
Item
Parser Error
Issue
Issue 5293: Unable to resolve the object (p. 320)
Resolution
Verify if object %s is present in the database. If it isn't, check the object name or add the object. If the object is present, transform the code manually.
PRAGMA
Item
PRAGMA
Issue
Issue 5571: PostgreSQL doesn't support
Resolution
Review the exception used, and if possible convert it to another condition.
SELECT
Item
FOR UPDATE SKIP
LOCKED
FOR UPDATE WAIT
Hierarchical queries
MODEL
OUTER JOIN
ROLLUP
Unsupported statement
Issue
BULK COLLECT INTO
Issue 5140: PostgreSQL doesn't support BULK
Issue 5139: PostgreSQL doesn't support FOR
Issue 5144: PostgreSQL doesn't support FOR
Resolution
You can try to include all of the fields from your table in an INTO clause.
Try using FOR UPDATE without SKIP LOCKED.
Try using FOR UPDATE without WAIT.
Issue 5586: Automatic conversion for queries with NOCYCLE clause not supported (p. 320)
Issue 5126: PostgreSQL doesn't support the
Perform a manual conversion.
Revise your code and try using user procedures and temporary tables.
Perform a manual conversion.
Issue 5585: Automatic conversion of an outer join into a correlation query is not supported (p. 320)
Issue 5557: PostgreSQL doesn't support
GROUPING SETS, CUBE, and ROLLUP functions (p. 321)
Issue 5578: Unable to automatically transform the SELECT statement (p. 321)
It can be emulated using
CTE expressions. GROUPING
SETS, CUBE, and ROLLUP ara available in PostgreSQL database v.9.5 or higher.
Try rewriting the statement.
Version 1.0
306
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
SEQUENCE
Item
STATUS=INVALID
Issue
Issue 5574: PostgreSQL doesn't support the sequence's status (p. 321)
Resolution
Check the original sequence for errors, and perform the conversion again.
Statements
Item
GOTO
Issue
Issue 5335: PostgreSQL doesn't support the
Resolution
Perform a manual conversion.
Synonym
Item
private synonym public synonym public synonym
Issue
Issue 5333: This object uses a private synonym (p. 321)
Issue 5593: This object uses a public synonym which doesn't reference any other objects (p. 322)
Resolution
Check that a referenced object created after synonym conversion exists.
Check that a referenced object created after synonym conversion exists.
Check that a referenced object created after synonym conversion exists.
System Package
Item
APEX_UTIL package
DBMS_DATAPUMP
DBMS_JOB module
Issue
Issue 5503: MySQL does not have functionality similar to %s module (p. 322)
Issue 5502: MySQL does not have functionality similar to %s module (p. 322)
Issue 5501: MySQL does not have functionality similar to %s module (p. 322)
UTL_MAIL module
Issue 5500: MySQL does not have functionality similar to %s module (p. 322)
Resolution
Try using the Amazon Simple
Workflow (Amazon SWF).
Try using the AWS Import/
Export Snowball.
Try using the AWS Lambda
Service with Scheduled
Events.
Try using the Amazon Simple
Notification Service (Amazon
SNS).
Version 1.0
307
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
TRIGGERS
Item
action-type=CALL or
PL/SQL base-objecttype=DATABASE
Issue
Issue 5313: PostgreSQL doesn't support the action-type clause (p. 322)
Issue 5415: PostgreSQL doesn't support system triggers (p. 322)
base-objecttype=SCHEMA
Issue 5311: PostgreSQL doesn't support system triggers (p. 323)
COMPOUND TRIGGER
Issue 5242: PostgreSQL doesn't support
FOLLOWS |
PRECEDES
ON NESTED TABLE
Issue 5241: PostgreSQL doesn't support the
FOLLOWS | PRECEDES clause (p. 323)
Issue 5240: PostgreSQL doesn't support triggers on nested table columns in views (p. 323)
Issue 5238: PostgreSQL doesn't support the
REFERENCING NEW
AS .. OLD AS ..
referencingnames=PARENT status=invalid
Issue 5317: PostgreSQL doesn't support the
PARENT referencing clause (p. 323)
Issue 5306: Transformation from invalid trigger (p. 323)
Issue 5556: PostgreSQL doesn't support conditional predicates (p. 323)
Resolution
Use another method for this functionality.
Revise your code to replace system triggers with another solution.
Revise your code to replace system triggers with another solution.
Create a single trigger for each part of the compound trigger.
Try using the FOR EACH ROW trigger.
Revise your code to replace nested table with another solution.
Modify references to pseudorows to use OLD and NEW instead.
Use another method for this functionality.
Check the original trigger for errors, and perform the conversion again.
Revise your code and try using simple triggers.
TRUNCATE TABLE
Item
DROP STORAGE
PRESERVE
MATERIALIZED VIEW
LOG
PURGE
MATERIALIZED VIEW
LOG
Issue
Issue 5298: PostgreSQL doesn't support the
DROP STORAGE clause in the TRUNCATE statement (p. 323)
Issue 5300: PostgreSQL doesn't support the PRESERVE clause in the TRUNCATE statement (p. 323)
Issue 5301: PostgreSQL doesn't support the PURGE clause in the TRUNCATE statement (p. 323)
Resolution
Use TRUNCATE without this option.
Use TRUNCATE without this option.
Use TRUNCATE without this option.
Version 1.0
308
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Item
REUSE STORAGE
Issue
Issue 5299: PostgreSQL doesn't support the
REUSE STORAGE clause in the TRUNCATE statement (p. 324)
Resolution
Use TRUNCATE without this option.
UDT
Item
STATUS=INVALID
Issue
Issue 5577: PostgreSQL doesn't support a
Resolution
Perform a manual conversion.
UDT collection-type arguments
Item Issue
:= collection_type(...)
Issue 5120: PostgreSQL doesn't support constructors of the "collection" type (p. 324)
EXTEND(n[,i])
Issue 5587: PostgreSQL doesn't support
EXTEND method with parameters (p. 324)
FORALL
Issue 5121: PostgreSQL doesn't support the
TYPE .. IS TABLE OF...
Issue 5118: PostgreSQL doesn't support table type variables (p. 324)
Resolution
Use the "array" type.
Perform a manual conversion.
Use a FOR LOOP statement.
Use the "array" type.
Universal
Item Issue
Universal action item
Issue 5339: The %s object is invalid (p. 324)
Universal action item
Issue 5591: The %s synonym is system (p. 325)
Resolution
To correct this, update the original source code to make the specified object valid.
Perform a manual conversion.
Unknown
Item
Unknown object
Unparsed SQL
Issue
Issue 5025: This syntactic element conversion is not supported yet (p. 325)
Issue 5351: Automatic conversion of %s object is not supported (p. 325)
Issue 5576: Unparsed SQL (p. 325)
Resolution
Perform a manual conversion.
Perform a manual conversion.
Perform a manual conversion.
Version 1.0
309
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
UPDATE
Item
ERROR LOG
PARTITION
QUERY
Issue
Issue 5064: PostgreSQL doesn't support the
UPDATE statement with the ERROR LOG option (p. 325)
Issue 5558: PostgreSQL doesn't support the
UPDATE statement for a PARTITION (p. 325)
Issue 5065: PostgreSQL doesn't support the
UPDATE statement for a subquery (p. 325)
Resolution
You can add error records by inserting them into the log in the exception block.
Iterate through the errors in the exception block, add them to the log, and use the EXIT command when finished.
Either insert data into the overlying partition, or perform a manual transformation using the
UPDATE statement.
Perform this operation on the underlying tables instead.
VIEW
Item
CAST (MULTISET( constraint
OID_TEXT IS NOT
NULL
PIVOT clause
STATUS=INVALID
VIEW_TYPE_OWNER
IS NOT NULL
WITH READ ONLY
Issue
Issue 5245: PostgreSQL doesn't support views with nested table columns (p. 326)
Resolution
Revise your code to replace nested table with another solution.
Perform a manual conversion.
Issue 5583: PostgreSQL doesn't support constraints for view (p. 326)
Issue 5321: PostgreSQL doesn't support the object view (p. 326)
Issue 5077: PostgreSQL doesn't support the PIVOT clause for the SELECT statement (p. 326)
Perform a manual conversion.
You can use a stored procedure to prepare data, and then return the data with a VIEW.
Perform a manual conversion.
Issue 5320: PostgreSQL doesn't support the view with invalid status (p. 326)
Issue 5322: PostgreSQL doesn't support the typed view (p. 326)
Issue 5075: PostgreSQL doesn't support VIEW with the READ ONLY option (p. 326)
Perform a manual conversion.
Use VIEW without this option instead.
Conversion Issues with Build_in_services
Issue 5590: The function was converted as procedure
Can't return a reply because this functionality is asynchronous.
Version 1.0
310
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with BUILT-IN SQL FUNCTIONS
Issue 5584: The function %s depends on the time zone setting
Review the transformed code, and set the time zone manually if necessary.
Issue 5340: PostgreSQL doesn't support the %s function
You have SQL code that uses an Oracle function that PostgreSQL doesn't support. Re-write the code to either use an alternative function or create a user-defined function instead. Some of the functions that are not supported are as follows:
• NANVL
• NLS_LOWER
• NLS_UPPER
• SYS_CONTEXT
Issue 5271: The Oracle GREATEST function and PostgreSQL GREATEST function might give different results
Review your transformed code and modify it to change the argument's type if necessary.
Issue 5272: The Oracle LEAST function and PostgreSQL LEAST function might give different results
Review your transformed code and modify it to change the argument's type if necessary.
Issue 5579: The second parameter of %s function can be processed incorrectly
Review your transformed code and modify it if necessary.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with CREATE
Issue 5099: Unable convert object due to %s not created
Review the %s object.
Issue 5332: The object has references on the object in %s schema
Convert the object in %s schema also.
Version 1.0
311
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Issue 5582: Encrypted Objects
Decrypt the object before conversion.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with CREATE CONSTRAINT
Issue 5326: PostgreSQL doesn't support constraints with the status DISABLED
PostgreSQL doesn't support the DISABLE clause on constraints. Drop the constraint prior to conversion.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with CREATE INDEX
Issue 5208: PostgreSQL doesn't support domain indexes
Revise your code to use a simple index instead.
Issue 5555: PostgreSQL doesn't support functional indexes that aren't singlecolumn
Revise your code to use a simple index instead.
Issue 5206: PostgreSQL doesn't support bitmap indexes
Revise your code to use a simple index instead.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with CREATE TABLE
Issue 5212: PostgreSQL doesn't have a data type BFILE
Either store a named file with the data and create a routine that gets that file from the file system, or store the data blob inside your database.
Version 1.0
312
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Issue 5201: PostgreSQL doesn't support all partition types
Perform a manual conversion for the partition types that aren't supported.
Issue 5199: PostgreSQL doesn't support CLUSTERED TABLE
Try using a table with triggers instead.
Issue 5200: PostgreSQL doesn't support EXTERNAL TABLES
Try moving the data from the external data source to a regular database table.
Issue 5198: PostgreSQL doesn't support GLOBAL TEMPORARY TABLE
Use of the GLOBAL and LOCAL keywords is deprecated in PostgreSQL. Modify your code to create a temporary table without using these keywords.
Issue 5196: PostgreSQL doesn't support OBJECT TABLE
Revise your code to remove references to tables that are based on an OBJECT type, as shown in the following example:
CREATE TYPE department_typ AS OBJECT
( d_name VARCHAR2(100),
d_address VARCHAR2(200) );
/
CREATE TABLE departments_obj_t OF department_typ;
Issue 5581: PostgreSQL doesn't support index-organized table
Revise your architecture with a custom solution for the table type. A typical approach is using a simple table instead in PostgreSQL.
Issue 5348: PostgreSQL doesn't support NESTED TABLES
Revise your code to avoid NESTED TABLE.
Issue 5550: PostgreSQL doesn't have a data type ROWID
Review your transformed code and modify it if necessary to use a different data type.
Issue 5554: PostgreSQL doesn't support virtual columns
Emulate the virtual column by using a trigger instead. For example, you could modify the following
Oracle table:
CREATE TABLE employees2 (
id NUMBER,
first_name VARCHAR2(10),
last_name VARCHAR2(10),
salary NUMBER(9,2),
comm1 NUMBER(3),
comm2 NUMBER(3),
salary1 AS (ROUND(salary*(1+comm1/100),2)),
salary2 NUMBER GENERATED ALWAYS AS (ROUND(salary*(1+comm2/100),2)) VIRTUAL,
CONSTRAINT employees_pk PRIMARY KEY (id)
);
Version 1.0
313
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
To the following PostgreSQL statements:
CREATE TABLE IF NOT EXISTS TEST_ORA_PG.employees2 (
id DOUBLE PRECISION NOT NULL,
first_name character varying(10),
last_name character varying(10),
salary NUMERIC(9,2),
comm1 NUMERIC(3,0),
comm2 NUMERIC(3,0),
salary1 DOUBLE PRECISION,
salary2 DOUBLE PRECISION
);
ALTER TABLE TEST_ORA_PG.EMPLOYEES2
ADD CONSTRAINT EMPLOYEES_PK PRIMARY KEY (ID);
CREATE OR REPLACE FUNCTION TEST_ORA_PG.f_trigger_vc$employees2 ()
RETURNS trigger
AS
$BODY$
BEGIN
new.salary1 := ROUND(new.salary*(1+new.comm1/100),2);
new.salary2 := ROUND(new.salary*(1+new.comm2/100),2); return NEW;
END;
$BODY$
LANGUAGE plpgsql;
CREATE TRIGGER trigger_vc$employees2 before insert or update on TEST_ORA_PG.employees2
for each row
EXECUTE PROCEDURE TEST_ORA_PG.f_trigger_vc$employees2();
Issue 5213: PostgreSQL expands fractional seconds support for TIME, DATETIME, and TIMESTAMP values, with up to microseconds (6 digits) of precision
Review your transformed code and modify it if necessary to avoid a loss of accuracy.
Issue 5552: PostgreSQL expands fractional seconds support for TIME, DATETIME, and TIMESTAMP values, with up to microseconds (6 digits) of precision
Review your transformed code and modify it if necessary to avoid a loss of accuracy.
Issue 5553: PostgreSQL expands fractional seconds support for TIME, DATETIME, and TIMESTAMP values, with up to microseconds (6 digits) of precision
Review your transformed code and modify it if necessary to avoid a loss of accuracy.
Issue 5551: PostgreSQL doesn't have a data type UROWID
Review your transformed code and modify it if necessary to use a different data type.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Version 1.0
314
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Conversion Issues with CREATE TYPE
Issue 5572: PostgreSQL doesn't support object type methods
Revise your architecture with a custom solution for the user type.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with CURSOR
Issue 5084: PostgreSQL doesn't support the cursor attribute %ISOPEN
Revise how you are using this attribute in your code.
Issue 5226: PostgreSQL doesn't support TYPE ... IS REF CURSOR
PostgreSQL doesn't support the TYPE <type_name> IS REF CURSOR statement. Change the function to a stored procedure and try using a table to store results instead.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Datetime Expressions
Issue 5594: PostgreSQL doesn't support %s datetime expression. The loss of precision and/or accuracy of data is possible
PostgreSQL doesn't support the AT LOCAL or AT TIME ZONE <time_zone> datetime expressions. Review your code and modify it if necessary.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with DELETE
Issue 5067: PostgreSQL doesn't support the DELETE statement with the ERROR
LOG option
You can add error records by inserting them into the log in the exception block. Iterate through the errors in the exception block, add them to the log, and use the EXIT command when finished.
Version 1.0
315
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Issue 5098: PostgreSQL doesn't support the DELETE statement for a PARTITION
Either insert data into the overlying partition, or perform a manual conversion using the DELETE statement.
Issue 5068: PostgreSQL doesn't support the DELETE statement for a subquery
Perform this operation on the underlying tables instead.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with DYNAMIC SQL
Issue 5088: PostgreSQL doesn't support the EXECUTE IMMEDIATE statement with BULK COLLECT
Perform a manual conversion.
Issue 5334: PostgreSQL doesn't support the dynamic SQL statement
Review and modify the execution string.
Issue 5087: PostgreSQL doesn't support the RETURNING BULK COLLECT INTO clause
Perform a manual conversion.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with EXCEPTION
Issue 5561: PostgreSQL doesn't support the ACCESS_INTO_NULL exception
Review the exception used, and if possible convert it to another condition.
Issue 5562: PostgreSQL doesn't support the COLLECTION_IS_NULL exception
Review the exception used, and if possible convert it to another condition.
Issue 5580: The exception block was emptied after conversion
Check converted code and make manual corrections if necessary.
Version 1.0
316
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Issue 5570: PostgreSQL doesn't support exception name declaration
Review the exception used, and if possible convert it to another condition.
Issue 5563: PostgreSQL doesn't support the NO_DATA_NEEDED exception
Review the exception used, and if possible convert it to another condition.
Issue 5560: PostgreSQL doesn't support the PROGRAM_ERROR exception
Review the exception used, and if possible convert it to another condition.
Issue 5564: PostgreSQL doesn't support the ROWTYPE_MISMATCH exception
Review the exception used, and if possible convert it to another condition.
Issue 5565: PostgreSQL doesn't support the SELF_IS_NULL exception
Review the exception used, and if possible convert it to another condition.
Issue 5566: PostgreSQL doesn't support the SUBSCRIPT_BEYOND_COUNT exception
Review the exception used, and if possible convert it to another condition.
Issue 5567: PostgreSQL doesn't support the SUBSCRIPT_OUTSIDE_LIMIT exception
Review the exception used, and if possible convert it to another condition.
Issue 5568: PostgreSQL doesn't support the SYS_INVALID_ROWID exception
Review the exception used, and if possible convert it to another condition.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with EXPLICIT CURSORS
Issue 5559: PostgreSQL doesn't support the RETURN TYPE for the cursor
PostgreSQL doesn't support specifying a return type for a cursor. Declare the cursor without this statement.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Version 1.0
317
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Conversion Issues with FUNCTION
Issue 5350: The function can't use statements that explicitly or implicitly begin or end a transaction, such as START TRANSACTION, COMMIT, or ROLLBACK
Revise your code to implement transaction control on the application side. Some cases that use
SAVEPOINT <name>… ROLLBACK TO <name> can be converted to BEGIN … EXCEPTION … END.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with INSERT
Issue 5070: PostgreSQL doesn't support the INSERT statement with the ERROR
LOG option
You can add error records by inserting them into the log in the exception block. Iterate through the errors in the exception block, add them to the log, and use the EXIT command when finished.
Issue 5024: PostgreSQL doesn't support the INSERT statement with partition_extension_clause
Perform a manual conversion for the partition types that aren't supported.
Issue 5071: PostgreSQL doesn't support the INSERT statement for a subquery
Perform this operation on the underlying tables instead.
Issue 5090: PostgreSQL doesn't support the INSERT statement for a
SUBPARTITION
Either insert data into the overlying partition, or perform a manual conversion using the INSERT statement.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with MATERIALIZED VIEW
Issue 5094: PostgreSQL doesn't support a materialized VIEW
Revise your code to replace the CREATE MATERIALIZED VIEW statement with another solution.
Issue 5095: PostgreSQL doesn't support using a materialized VIEW
Revise your code to replace the materialized view with another solution.
Version 1.0
318
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with MERGE
Issue 5102: PostgreSQL doesn't support the MERGE statement
To achieve the effect of a MERGE statement, use separate INSERT, DELETE, and UPDATE statements.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Optimizer Hints
Issue 5103: PostgreSQL doesn't support the %s hint
Use PostgreSQL methods for performance tuning.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with PACKAGES
Issue 5330: PostgreSQL doesn't support global cursors
Use another method for this functionality.
Issue 5331: PostgreSQL doesn't support a global user exception
Use another method for this functionality.
Issue 5569: PostgreSQL only supports session variables using SQL standard date and time types
If your code uses variables of other types, such as associative arrays, cursors, ref cursors, or subtypes, revise your architecture with a custom solution for replacing that type.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Version 1.0
319
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Conversion Issues with Parser Error
Issue 5293: Unable to resolve the object
Verify if object <object_name> is present in the database. If it isn't, check the object name or add the object. If the object is present, transform the code manually.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with PRAGMA
Issue 5571: PostgreSQL doesn't support PRAGMA options
Review the exception used, and if possible convert it to another condition.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with SELECT
Issue 5140: PostgreSQL doesn't support BULK COLLECT INTO
Include all of the fields from your table in an INTO clause instead.
Issue 5139: PostgreSQL doesn't support FOR UPDATE SKIP LOCKED
Try using FOR UPDATE without SKIP LOCKED.
Issue 5144: PostgreSQL doesn't support FOR UPDATE WAIT clauses
Try using FOR UPDATE without WAIT.
Issue 5586: Automatic conversion for queries with NOCYCLE clause not supported
Perform a manual conversion.
Issue 5126: PostgreSQL doesn't support the MODEL statement
Revise your code. Try using user procedures and temporary tables instead.
Issue 5585: Automatic conversion of an outer join into a correlation query is not supported
Perform a manual conversion.
Version 1.0
320
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Issue 5557: PostgreSQL doesn't support GROUPING SETS, CUBE, and ROLLUP functions
These functions can be emulated using CTE expressions instead. GROUPING SETS, CUBE, and ROLLUP functionality is available in PostgreSQL v.9.5 or higher.
Issue 5578: Unable to automatically transform the SELECT statement
The indicated SELECT statement contains language that can't be converted, for example an unsupported function. Try rewriting the statement.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with SEQUENCE
Issue 5574: PostgreSQL doesn't support the sequence's status
Check the original sequence for errors, and perform the conversion again.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Statements
Issue 5335: PostgreSQL doesn't support the GOTO operator
PostgreSQL doesn't support the GOTO operator in stored procedures. Try one of the following alternatives instead:
• Set a flag and test for it.
• Return from the procedure if updates should be made, and add the updates after the return.
• Put the updates in another stored procedure, and call it in your IF statements.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Synonym
Issue 5333: This object uses a private synonym
Check that a referenced object created after synonym conversion exists.
Version 1.0
321
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Issue 5592: This object uses a public synonym which references a table, a view, or a function
Check that a referenced object created after synonym conversion exists.
Issue 5593: This object uses a public synonym which doesn't reference any other objects
Check that a referenced object created after synonym conversion exists.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with System Package
Issue 5503: MySQL does not have functionality similar to %s module
Try using Amazon Simple Workflow (Amazon SWF). For more information, see What Is Amazon Simple
Workflow Service?
in the Amazon Simple Workflow Service Developer Guide.
Issue 5502: MySQL does not have functionality similar to %s module
Try using AWS Snowball. For more information, see What Is AWS Snowball?
Issue 5501: MySQL does not have functionality similar to %s module
Try using the AWS Lambda service with Scheduled Events. For more information, see What Is AWS
Lambda?
Issue 5500: MySQL does not have functionality similar to %s module
Try using the Amazon Simple Queue Service (Amazon SQS). For more information, see What is Amazon
Simple Queue Service?
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with TRIGGERS
Issue 5313: PostgreSQL doesn't support the action-type clause
Use another method for this functionality.
Issue 5415: PostgreSQL doesn't support system triggers
Revise your code to replace system triggers with another solution.
Version 1.0
322
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Issue 5311: PostgreSQL doesn't support system triggers
Revise your code to replace system triggers with another solution.
Issue 5242: PostgreSQL doesn't support COMPOUND TRIGGER
Create a single trigger for each part of the compound trigger.
Issue 5241: PostgreSQL doesn't support the FOLLOWS | PRECEDES clause
Try using the FOR EACH ROW trigger.
Issue 5240: PostgreSQL doesn't support triggers on nested table columns in views
Revise your code to replace the nested table with another solution.
Issue 5238: PostgreSQL doesn't support the REFERENCING clauses
Modify references to pseudo-rows to use OLD and NEW instead.
Issue 5317: PostgreSQL doesn't support the PARENT referencing clause
Use another method for this functionality.
Issue 5306: Transformation from invalid trigger
Check the original trigger for errors, and perform the conversion again.
Issue 5556: PostgreSQL doesn't support conditional predicates
Revise your code and try using simple triggers instead.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with TRUNCATE TABLE
Issue 5298: PostgreSQL doesn't support the DROP STORAGE clause in the
TRUNCATE statement
Use the TRUNCATE TABLE statement without this option.
Issue 5300: PostgreSQL doesn't support the PRESERVE clause in the TRUNCATE statement
Use the TRUNCATE TABLE statement without this option.
Issue 5301: PostgreSQL doesn't support the PURGE clause in the TRUNCATE statement
Use the TRUNCATE TABLE statement without this option.
Version 1.0
323
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Issue 5299: PostgreSQL doesn't support the REUSE STORAGE clause in the
TRUNCATE statement
Use the TRUNCATE TABLE statement without this option.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with UDT
Issue 5577: PostgreSQL doesn't support a UDT with body
Perform a manual conversion.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with UDT collection-type arguments
Issue 5120: PostgreSQL doesn't support constructors of the "collection" type
Use the "array" type instead.
Issue 5587: PostgreSQL doesn't support EXTEND method with parameters
Perform a manual conversion.
Issue 5121: PostgreSQL doesn't support the FORALL statement
Use a FOR LOOP statement instead.
Issue 5118: PostgreSQL doesn't support table type variables
Use the "array" type instead.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Universal
Issue 5339: The %s object is invalid
Revise the original source code to make the specified object valid.
Version 1.0
324
AWS Schema Conversion Tool User Guide
Oracle to PostgreSQL Conversion Reference
Issue 5591: The %s synonym is system
Perform a manual conversion.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Unknown
Issue 5025: This syntactic element conversion is not supported yet
Perform a manual conversion.
Issue 5351: Automatic conversion of %s object is not supported
Perform a manual conversion.
Issue 5576: Unparsed SQL
Perform a manual conversion.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with UPDATE
Issue 5064: PostgreSQL doesn't support the UPDATE statement with the ERROR
LOG option
You can add error records by inserting them into the log in the exception block. Iterate through the errors in the exception block, add them to the log, and use the EXIT command when finished.
Issue 5558: PostgreSQL doesn't support the UPDATE statement for a PARTITION
Either insert data into the overlying partition, or perform a manual transformation using the UPDATE statement.
Issue 5065: PostgreSQL doesn't support the UPDATE statement for a subquery
Perform this operation on the underlying tables instead.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
Version 1.0
325
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Supported Schema Conversion
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with VIEW
Issue 5245: PostgreSQL doesn't support views with nested table columns
Revise your code to replace the nested table with another solution.
Issue 5583: PostgreSQL doesn't support constraints for view
Perform a manual conversion.
Issue 5321: PostgreSQL doesn't support the object view
Perform a manual conversion.
Issue 5077: PostgreSQL doesn't support the PIVOT clause for the SELECT statement
You can use a stored procedure to prepare data, and then return the data with a view.
Issue 5320: PostgreSQL doesn't support the view with invalid status
Perform a manual conversion.
Issue 5322: PostgreSQL doesn't support the typed view
Perform a manual conversion.
Issue 5075: PostgreSQL doesn't support VIEW with the READ ONLY option
Create the view without this option instead.
Related Topics
•
Oracle to PostgreSQL Conversion Reference (p. 299)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Related Topics
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
PostgreSQL to MySQL Supported Schema
Conversion
The following sections list the schema elements from a PostgreSQL database and whether they are supported for automatic conversion to MySQL using the AWS Schema Conversion Tool.
Version 1.0
326
AWS Schema Conversion Tool User Guide
DDL
DDL
Statements
Tables
Clause Automatically
Converted
Details
ALTER TABLE Yes
Auto-incremented columns Yes
Columns with default values
Partial
Issue 6115: MySQL doesn't support expressions in
DEFAULT constraints, so they are converted to a BEFORE
CREATE TABLE
Deferrable constraints
Yes
Partial
Issue 6111: MySQL doesn't support deferrable constraints (p. 370)
DROP TABLE
Expression as default value for column
Yes
Partial
Issue 6115: MySQL doesn't support expressions in
DEFAULT constraints, so they are converted to a BEFORE
Foreign keys
Not-null columns
Partial
Partial
Issue 6117: Unable to keep the NOT NULL constraint for
%s column while converting its DEFAULT constraint based on an expression (p. 371)
Issue 6114: MySQL doesn't support SET DEFAULT as a referential action in foreign keys (p. 370)
Issue 6117: Unable to keep the NOT NULL constraint for
%s column while converting its DEFAULT constraint based on an expression (p. 371)
Primary keys
Regular tables
Table inheritance
Yes
Yes
No
Tables with check constraints
Partial
Issue 6108: MySQL doesn't support inherited tables (p. 371)
Tables with exclusion constraints
Tables without columns
Trigger disablement
Partial
No
No
Issue 6112: MySQL doesn't support exclusion constraints (p. 370)
Issue 6109: MySQL doesn't support typed tables (p. 372)
Issue 6087: MySQL doesn't support disabling triggers (p. 372)
Version 1.0
327
AWS Schema Conversion Tool User Guide
DML
Clause
Typed tables
Unique keys
Unlogged tables
Automatically
Converted
Details
No
Issue 6110: MySQL doesn't support tables without columns (p. 371)
Issue 6120: MySQL doesn't support user-defined data types (p. 374)
Yes
No
Issue 6107: MySQL doesn't support unlogged tables (p. 371)
DML
Built-In SQL Functions
Aggregate
Clause
All
Automatically
Converted
Details
Partial
Issue 6667: MySQL doesn't support the %s function (p. 357)
Character
Clause
All
Automatically
Converted
Details
Partial
Issue 6667: MySQL doesn't support the %s function (p. 357)
Conversion
Clause
All
Automatically
Converted
Details
Partial
Issue 6667: MySQL doesn't support the %s function (p. 357)
DateTime
Clause
All
Automatically
Converted
Details
Partial
Issue 6667: MySQL doesn't support the %s function (p. 357)
Version 1.0
328
AWS Schema Conversion Tool User Guide
DML
Numeric
Clause
All
Automatically
Converted
Details
Partial
Issue 6667: MySQL doesn't support the %s function (p. 357)
Other
Clause
All
Automatically
Converted
Details
Partial
Issue 6667: MySQL doesn't support the %s function (p. 357)
Window
Clause
All
Automatically
Converted
Details
No
Issue 6667: MySQL doesn't support the %s function (p. 357)
XML
Clause
All
Automatically
Converted
Details
No
Issue 6667: MySQL doesn't support the %s function (p. 357)
Joins
TRUNCATE TABLE
Clause Automatically
Converted
Details
[NATURAL ] [ INNER ] JOIN Yes
[NATURAL ] {LEFT |RIGHT |
FULL } [ OUTER ] JOIN
Yes
CROSS JOIN Yes
USING ( join_column [, ...] ) Yes
Version 1.0
329
AWS Schema Conversion Tool User Guide
DML
Operators and Date Functions
Bit String Operators
Clause
||,&,|,#,~,<<,>>,
Automatically
Converted
Details
Yes
Date/Time Operators
Clause
+,-,*,/
Automatically
Converted
Details
Partial
Issue 6661: The operation will return the number of days instead of the interval value (p. 365)
Mathematical Operators
Clause Automatically
Converted
Details
+,-,*,/,
%,^,|/,||/,!,!!,@,&,|,#,~,<<,>>,
Yes
String Operators
Clause
||
Automatically
Converted
Details
Yes
Predicates
SIMILAR Predicate
Clause
SIMILAR
Automatically
Converted
Details
No
Issue 6607: Could not convert pattern to MySQL version; check pattern manually (p. 367)
Boolean Conditions
Clause
All
Automatically
Converted
Details
Yes
Version 1.0
330
AWS Schema Conversion Tool User Guide
DML
Comparison Condition
Clause
'=, <>, <, <=, >, >=
ANY, SOME, ALL
Automatically
Converted
Details
Yes
Yes
Exists Conditions
Clause
EXISTS
In Conditions
Clause
IN
Automatically
Converted
Details
Yes
Automatically
Converted
Details
Yes
Null Conditions
Clause
NULL
Automatically
Converted
Details
Yes
Pattern-Matching Conditions
Clause
All
Automatically
Converted
Details
Yes
Range Conditions
Clause
All
Automatically
Converted
Details
Yes
Version 1.0
331
AWS Schema Conversion Tool User Guide
DML
Set Operators
Text Search Functions and Operators
Clause
EXCEPT
INTERSECT
UNION
Automatically
Converted
Details
Yes
Yes
Yes
Statements
INSERT
Clause
INSERT INTO table
DEFAULT VALUES;
INSERT INTO table query;
INSERT INTO table
VALUES() RETURNING *;
INSERT INTO table
VALUES() RETURNING
{output_expression [ AS output_name ] [, ...]};
INSERT INTO table
VALUES();
INSERT INTO table
VALUES({ expression
| DEFAULT }
[, ...] ),VALUES({ expression |
DEFAULT } [, ...] ) [, ...];
INSERT INTO table
VALUES({ expression |
DEFAULT } [, ...] );
INSERT INTO table(array)
VALUES({'{' '}[,..]'});
INSERT INTO table[( column [, ...] )]
VALUES();
WITH RECURSIVE with_query [, ...]
UPDATE table_name
SET { column_name =
Automatically
Converted
Details
Yes
Yes
No
No
Yes
Yes
Yes
Yes
Yes
No
Issue 6172: MySQL doesn't support the INSERT statement with the RETURNING option (p. 363)
Issue 6172: MySQL doesn't support the INSERT statement with the RETURNING option (p. 363)
Issue 6127: MySQL doesn't support the WITH RECURSIVE clause (p. 368)
Version 1.0
332
AWS Schema Conversion Tool User Guide
DML
Clause
{ expression | DEFAULT }}
[, ...]
WITH with_query [, ...]
UPDATE table_name
SET { column_name =
{ expression | DEFAULT }}
[, ...]
Automatically
Converted
Details
Yes
SELECT
Clause
Add or subtract operators
EXCEPT [ALL]
FROM [ONLY] tablename
[*]
FROM { with_query_name | function_name()}
FROM {(subquery) [ AS ] alias |(VALUES({ expression
| DEFAULT } [, ...])) [ AS ] alias }
FROM tablename [ [ AS ] alias ]
GROUP BY
HAVING
INTERSECT [ALL]
No
Yes
Yes
Yes
Yes
Partial
LIMIT { count | ALL }
OFFSET start { ROW |
ROWS }
OFFSET start { ROW |
ROWS } FETCH { FIRST |
NEXT } [ count ] { ROW |
ROWS } ONLY
ORDER BY [ ASC | DESC |
USING operator ] [ NULLS
{ FIRST | LAST } ] [, ...]
Partial
Partial
Yes
SELECT {* | expression
[ [ AS ] output_name ] [, ...]}
FROM table
Yes
Automatically
Converted
Details
Yes
Partial
Issue 6612: Query with INTERSECT/EXCEPT ALL operator was transformed (p. 363)
No
Issue 6603: Can't use function in from clause (p. 361)
Issue 6612: Query with INTERSECT/EXCEPT ALL operator was transformed (p. 363)
Issue 6611: LIMIT/OFFSET option was omitted (p. 364)
Issue 6611: LIMIT/OFFSET option was omitted (p. 364)
Version 1.0
333
AWS Schema Conversion Tool User Guide
DML
Clause Automatically
Converted
Details
Yes SELECT {expression [ [ AS ] output_name ] [, ...]}
SELECT ALL
SELECT DISTINCT
SELECT DISTINCT ON
UNION [ALL]
Yes
Yes
No
Yes
WHERE (field_name1,
…,fieldnameN) IN
Yes
(subquery_with_multiple_fields)
WHERE comparison_condition
(=;<>;!
=;<;>;>=;<=;ANY;SOME;ALL)
Yes
WHERE Yes compound_condition_with_or_and_not
WHERE field_name
BETWEEN arg1 AND arg2
Yes
Yes WHERE field_name IN
(const1,...,constN)
WHERE field_name IN
(subquery)
WHERE like_condition
(operator LIKE)
WITH RECURSIVE with_query [, ...]
WITH with_query [, ...]
Yes
Yes
No
Yes
Issue 6127: MySQL doesn't support the WITH RECURSIVE clause (p. 368)
WINDOW DEFINITION
DELETE
Clause Automatically
Converted
Details
No
Issue 6672: MySQL does not support delete by cursor (p. 360)
DELETE FROM table_name
WHERE CURRENT OF cursor_name
DELETE FROM table_name
FROM from_list WHERE condition
Yes
Version 1.0
334
AWS Schema Conversion Tool User Guide
DML
Clause
DELETE FROM table_name RETURNING
{output_expression [ AS output_name ] [, ...]}
DELETE FROM table_name
RETURNING *
DELETE FROM table_name
WHERE condition
DELETE FROM ONLY table
[ [ AS ] alias ]
DELETE FROM table [ [ AS ] alias ]
DELETE FROM table *
[ [ AS ] alias ]
Automatically
Converted
Details
No
Issue 6069: MySQL doesn't support the DELETE statement with the RETURNING option (p. 359)
No
Yes
No
Yes
No
Issue 6069: MySQL doesn't support the DELETE statement with the RETURNING option (p. 359)
Issue 6603: Can't use function in from clause (p. 361)
SELECT
Clause
[ existing_window_name ]
[ PARTITION BY expression
[, ...] ] [ ORDER BY expression [ ASC | DESC |
USING operator ] [ NULLS
{ FIRST | LAST } ] [, ...] ]
[ frame_clause ]
Automatically
Converted
Details
No
Issue 6678: MySQL doesn't support function %s with
OVER/ORDER BY/WITHIN GROUP/FILTER clause (p. 356)
UPDATE
Clause
UPDATE ONLY table_name
SET { column_name =
{ expression | DEFAULT }}
[, ...]
UPDATE table_name *
SET { column_name =
{ expression | DEFAULT }}
[, ...]
UPDATE table_name [ [ AS ] alias ] SET { column_name
= { expression | DEFAULT }}
[, ...]
Automatically
Converted
Details
No
No
Yes
Version 1.0
335
AWS Schema Conversion Tool User Guide
DML
Clause
UPDATE table_name
SET { column_name =
{ expression | DEFAULT }}
[, ...]
UPDATE table_name
SET { column_name =
{ expression | DEFAULT }}
[, ...] WHERE CURRENT OF cursor_name
UPDATE table_name
SET { column_name =
{ expression | DEFAULT }}
[, ...] FROM from_list
WHERE condition
UPDATE table_name
SET { column_name =
{ expression | DEFAULT }}
[, ...] RETURNING
{output_expression [ AS output_name ] [, ...]}
UPDATE table_name
SET { column_name =
{ expression | DEFAULT }}
[, ...] RETURNING *
UPDATE table_name
SET { column_name =
{ expression | DEFAULT }}
[, ...] WHERE condition
UPDATE table_name SET
{( column_name [, ...] ) =
( { expression | DEFAULT }
[, ...] ) } [, ...]
UPDATE table_name SET
{( column_name [, ...] ) =
( query ) }
WITH RECURSIVE with_query [, ...]
UPDATE table_name
SET { column_name =
{ expression | DEFAULT }}
[, ...]
WITH with_query [, ...]
UPDATE table_name
SET { column_name =
{ expression | DEFAULT }}
[, ...]
Automatically
Converted
Details
Yes
No
Partial
No
No
Yes
Yes
Yes
No
Yes
Issue 6672: MySQL does not support delete by cursor (p. 360)
Issue 6669: FROM clause was rewritten (p. 375)
Issue 6066: MySQL doesn't support the UPDATE statement with the RETURNING option (p. 375)
Issue 6066: MySQL doesn't support the UPDATE statement with the RETURNING option (p. 375)
Issue 6127: MySQL doesn't support the WITH RECURSIVE clause (p. 368)
Version 1.0
336
AWS Schema Conversion Tool User Guide
PL/pgSQL
PL/pgSQL
Basic Statements
Assignment
Clause
Variable assignment
Automatically
Converted
Details
Partial
Issue 6668: MySQL doesn't support ROW/RECORD type (p. 367)
Executing a Command with No Result
Clause
PERFORM
Automatically
Converted
Details
Yes
Executing a Query with a Single-Row Result
Clause
INTO
Automatically
Converted
Details
No
Issue 6668: MySQL doesn't support ROW/RECORD type (p. 367)
Executing Dynamic Commands
Clause
EXECUTE, INTO, STRICT,
USING
Automatically
Converted
Details
No
Issue 6334: MySQL doesn't support the dynamic SQL statement RETURN QUERY EXECUTE (p. 360)
Category
Simple Structure of PL/pgSQL
Clause
DECLARE, BEGIN, END
Automatically
Converted
Details
Yes
Version 1.0
337
AWS Schema Conversion Tool User Guide
PL/pgSQL
Conditionals
IF-THEN
Clause
IF, THEN, END IF
Automatically
Converted
Details
Yes
IF-THEN-ELSE
Clause
IF, THEN, ELSE, END IF
Automatically
Converted
Details
Yes
IF-THEN-ELSIF
Clause
IF, THEN, ELSE, ELSIF, END
IF
Automatically
Converted
Details
Yes
Searched CASE
Clause
CASE,WHEN, THEN, ELSE,
END CASE
Automatically
Converted
Details
Yes
Simple CASE
Clause
CASE,WHEN, THEN, ELSE,
END CASE
Automatically
Converted
Details
Yes
Cursors
CLOSE
Clause
CLOSE
Automatically
Converted
Details
Yes
Version 1.0
338
AWS Schema Conversion Tool User Guide
PL/pgSQL
Declaring Cursor Variables
Clause Automatically
Converted
Details
NO, SCROLL, CURSOR, FOR No
Issue 6337: MySQL doesn't support a variable of
FETCH
Clause
FETCH [ direction { FROM |
IN } ] cursor INTO target;
Automatically
Converted
Details
Partial
Issue 6639: MySQL doesn't support the direction clause (p. 358)
MOVE
Clause
MOVE [ direction { FROM |
IN } ] cursor;
Automatically
Converted
Details
No
Issue 6640: MySQL doesn't support the MOVE option (p. 358)
OPEN FOR EXECUTE
Clause
OPEN, NO, SCROLL, FOR,
EXECUTE, USING
Automatically
Converted
Details
No
Issue 6337: MySQL doesn't support a variable of
OPEN FOR Query
Clause
OPEN, NO, SCROLL, FOR
Automatically
Converted
Details
No
Issue 6638: MySQL doesn't support the SCROLL option in cursors (p. 358)
Opening a Bound Cursor
Clause
OPEN bound_cursorvar
[ ( [ argument_name := ] argument_value [, ...] ) ];
Automatically
Converted
Details
Yes
Version 1.0
339
AWS Schema Conversion Tool User Guide
PL/pgSQL
Declarations
ALIAS
Clause
ALIAS FOR
Automatically
Converted
Details
Yes
Collation of PL/pgSQL Variables
Clause
COLLATE
Automatically
Converted
Details
No
Copying Types
Clause
%TYPE, %ROWTYPE
Automatically
Converted
Details
Yes
Declaring Function Parameters
Clause
Declaring function parameters
Automatically
Converted
Details
Yes
Record Types
Clause
Record types
Automatically
Converted
Details
Yes
Issue 6613: Unable to convert a function without OUT parameters returning a RECORD type (p. 362)
Variable Declaration
Clause
Variable declaration
Automatically
Converted
Details
Yes
Version 1.0
340
AWS Schema Conversion Tool User Guide
PL/pgSQL
Errors and Messages
CLOSE
Clause
RAISE ;
Automatically
Converted
Details
No
No
Issue 6329: MySQL doesn't support the RAISE exception (p. 361)
Issue 6329: MySQL doesn't support the RAISE exception (p. 361)
RAISE [ level ] condition_name [ USING option = expression [, ... ] ];
RAISE [ level ] 'format' [, expression [, ... ]] [ USING option = expression [, ... ] ];
RAISE [ level ] SQLSTATE
'sqlstate' [ USING option = expression [, ... ] ];
RAISE [ level ] USING option = expression [, ... ];
Partial
No
Partial
Issue 6332: MySQL doesn't support the RAISE statement to report messages (p. 365)
Issue 6329: MySQL doesn't support the RAISE exception (p. 361)
Issue 6332: MySQL doesn't support the RAISE statement to report messages (p. 365)
Obtaining the Result Status
Clause
GET [ CURRENT ]
DIAGNOSTICS variable = item [ , ... ];
Automatically
Converted
Details
No
Issue 6665: MySQL doesn't support the GET [ CURRENT ]
Options
Clause
EXCEPTION WHEN condition [ OR condition ... ]
THEN handler_statements
[..] END;
MESSAGE, DETAIL, HINT,
ERRCODE,
No
Automatically
Converted
Details
Partial
Issue 6664: MySQL doesn't support the condition information %s (p. 360)
Issue 6332: MySQL doesn't support the RAISE statement to report messages (p. 365)
Result Status Parameters
Clause
COLUMN_NAME
CONSTRAINT_NAME
Automatically
Converted
Details
Yes
Yes
Version 1.0
341
AWS Schema Conversion Tool User Guide
PL/pgSQL
Clause
MESSAGE_TEXT
PG_DATATYPE_NAME
Automatically
Converted
Details
No
No
Issue 6664: MySQL doesn't support the condition information %s (p. 360)
Issue 6664: MySQL doesn't support the condition information %s (p. 360)
PG_EXCEPTION_CONTEXT No
PG_EXCEPTION_DETAIL
PG_EXCEPTION_HINT
No
No
Issue 6664: MySQL doesn't support the condition information %s (p. 360)
Issue 6664: MySQL doesn't support the condition information %s (p. 360)
Issue 6664: MySQL doesn't support the condition information %s (p. 360)
RETURNED_SQLSTATE
SCHEMA_NAME
Yes
No
TABLE_NAME No
Issue 6664: MySQL doesn't support the condition information %s (p. 360)
Issue 6664: MySQL doesn't support the condition information %s (p. 360)
Loops
CONTINUE
Clause
CONTINUE, WHEN
Automatically
Converted
Details
Yes
EXIT
Clause
EXIT, WHEN
Automatically
Converted
Details
Yes
FOR (Integer Variant)
Clause
FOR, IN, LOOP, END LOOP,
REVERSE, BY
Automatically
Converted
Details
Yes
Version 1.0
342
AWS Schema Conversion Tool User Guide
PL/pgSQL
LOOP
Clause
LOOP, END LOOP
Automatically
Converted
Details
Yes
Looping Through Arrays
Clause
FOREACH, IN, LOOP, END
LOOP, SLICE, IN ARRAY
Automatically
Converted
Details
No
Issue 6608: MySQL doesn't support arrays (p. 357)
Looping Through Query Results
Clause
FOR, IN, LOOP, END LOOP,
EXECUTE, USING
Automatically
Converted
Details
Yes
WHILE
Clause
WHILE, LOOP, END LOOP
Automatically
Converted
Details
Yes
RETURN Statement
NULL; Command
Clause
RETURN
RETURN NEXT
RETURN QUERY
RETURN QUERY EXECUTE
Automatically
Converted
Details
Yes
No
Issue 6604: MySQL doesn't support RETURN NEXT clause (p. 362)
Yes
No
Issue 6334: MySQL doesn't support the dynamic SQL statement RETURN QUERY EXECUTE (p. 360)
Version 1.0
343
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
PostgreSQL to MySQL Conversion Reference
AGGREGATE FUNCTION
Item
bit_and, bit_or
OVER/ORDER BY/
WITHIN GROUP/
FILTER
Issue
Issue 6680: Check working of function with null values (p. 356)
Issue 6678: MySQL doesn't support function
%s with OVER/ORDER BY/WITHIN GROUP/
Resolution
Perform a manual conversion.
Perform a manual conversion.
ALTER
Item
ALTER
Issue
Issue 6676: Automatic conversion of the
ALTER statement isn't supported (p. 356)
Resolution
Perform a manual conversion.
Arithmetic Operators
Item
Arithmetic operators and string type
Issue
Resolution
Make cast operands to the expected type.
ARRAY
Item
ARRAY
Issue
Issue 6608: MySQL doesn't support arrays (p. 357)
Resolution
Perform a manual conversion.
Buildin function
Item
DateTime
Issue
Issue 6677: MySQL does not support time zone (p. 357)
BUILT-IN SQL FUNCTIONS
Item
BUILT-IN SQL
FUNCTIONS
Issue
Issue 6667: MySQL doesn't support the %s function (p. 357)
Version 1.0
344
Resolution
Perform a manual conversion.
Resolution
Create a user-defined function.
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
CREATE
Item
CREATE
Issue
Issue 6094: Unable to convert object due to
Resolution
Review the %s object.
CURSOR
Item
CURSOR with clause
NEXT, PRIOR, FIRST,
LAST, ABSOLUTE,
RELATIVE, FORWARD or BACKWARD
CURSOR with MOVE option
CURSOR with options
SCROLL or NO
SCROLL
REFCURSOR
Issue
Issue 6639: MySQL doesn't support the direction clause (p. 358)
Resolution
Perform a manual conversion.
Issue 6640: MySQL doesn't support the MOVE option (p. 358)
Issue 6638: MySQL doesn't support the
SCROLL option in cursors (p. 358)
Issue 6337: MySQL doesn't support a variable of REFCURSOR type (p. 358)
Perform a manual conversion.
Revise your code to eliminate cursors with the SCROLL option.
Try using temporary tables.
Databases
Item
ALTER DATABASE
CREATE DATABASE,
DROP DATABASE
Issue
Issue 6101: MySQL doesn't support this clause in an ALTER DATABASE statement (p. 358)
Issue 6100: The database-to-database migration is not provided (p. 358)
Resolution
Perform a manual conversion.
Use the schema-to-database migration plan.
DATA TYPES
Item
CAST( ... AS BIT | BIT
VARYING | VARBIT |
DECIMAL | NUMERIC
| REAL | FLOAT4 |
DOUBLE PRECISION |
FLOAT8 | CHARACTER
| CHAR | CHARACTER
VARYING | TEXT |
TIME WITH TIME
ZONE | TIME(p)
WITH TIME ZONE
| TIMESTAMP
WITH TIME ZONE |
Issue
Resolution
Check if the data violates these restrictions. If so, perform a manual migration.
Version 1.0
345
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Item
TIMESTAMP(p) WITH
TIME )
CAST( ... AS BOX
| POINT | LINE
| LSEG | PATH |
POLYGON | CIRCLE |
TXID_SNAPSHOT)
Issue Resolution
Issue 6674: MySQL doesn't support %s type in the CAST function (p. 359)
Check if the data violates these restrictions. If so, perform a manual migration.
DELETE
Item
RETURNING
Issue
Issue 6069: MySQL doesn't support the
DELETE statement with the RETURNING option (p. 359)
WHERE CURRENT OF
Issue 6672: MySQL does not support delete by cursor (p. 360)
Resolution
To perform this operation, divide the DELETE statement with the RETURNING clause into a DELETE statement with following INSERT statements and use the same key conditions in each
SELECT.
Perform a manual conversion.
Domains
Item
CREATE DOMAIN,
ALTER DOMAIN,
DROP DOMAIN
Issue
Issue 6050: MySQL doesn't support domains (p. 360)
DYNAMIC SQL
Item
RETURN QUERY
EXECUTE
Issue
Issue 6334: MySQL doesn't support the dynamic SQL statement RETURN QUERY
Error Handling
Item
GET [CURRENT]
DIAGNOSTICS ... PG_
CONTEXT
GET STACKED
DIAGNOSTICS
Issue
Issue 6665: MySQL doesn't support the GET [ CURRENT ] DIAGNOSTICS command (p. 360)
Issue 6664: MySQL doesn't support the condition information %s (p. 360)
Version 1.0
346
Resolution
Perform a manual conversion.
Resolution
Review and modify the execution string.
Resolution
Perform a manual conversion.
Perform a manual conversion.
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Item Issue
PG_DATATYPE_NAME|
TABLE_NAME|
SCHEMA_NAME|
PG_EXCEPTION_DETAIL|
PG_EXCEPTION_HINT|
PG_EXCEPTION_CONTEXT
RAISE [exception]
Issue 6329: MySQL doesn't support the RAISE exception (p. 361)
Resolution
Review the RAISE exception used, and if possible convert it to an exception using the SIGNAL or RESIGNAL statement.
EXCEPTIONS
Item
EXCEPTIONS
Issue
Issue 6342: MySQL doesn't support the %s condition name (p. 361)
Resolution
Review the exception used, and if possible convert it to an exception using the SIGNAL or RESIGNAL statement.
FROM
Item
FROM
QUERY
Issue
Issue 6603: Can't use function in from clause (p. 361)
Issue 6682: Can't use the table-value function in the from clause (p. 361)
Resolution
Perform a manual conversion.
MySQL does not support the table-value function.
FUNCTION
Item
language
RECORD
Issue
Issue 6675: Automatic conversion function on
%s language isn't supported (p. 361)
Issue 6613: Unable to convert a function without OUT parameters returning a RECORD type (p. 362)
Resolution
Perform a manual conversion.
Perform a manual conversion.
Functions
Item
RETURN NEXT
Issue
Issue 6604: MySQL doesn't support RETURN
Version 1.0
347
Resolution
Perform a manual conversion.
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Item
VARIADIC
Issue
Issue 6605: MySQL doesn't support VARIADIC mode of an argument (p. 362)
Resolution
Perform a manual conversion.
Indexes
Item
CREATE INDEX: GiST,
SPGiST, Gin methods
Expression-based indexes
Ordered indexes
Issue
Issue 6091: MySQL doesn't support %s index method (p. 362)
Issue 6090: MySQL doesn't support indexes on expressions (p. 362)
Issue 6092: MySQL doesn't support explicit sort ordering in the index definition (p. 362)
Partial indexes
Issue 6093: MySQL doesn't support partial indexes (p. 362)
Resolution
Perform a manual conversion.
Perform a manual conversion.
If default (ascending) sort order in the index might cause performance degradation, perform a manual conversion or rewrite statements supposed to use it.
If the full index might cause performance degradation, perform a manual conversion.
INSERT
Item
RETURNING
Issue
Issue 6172: MySQL doesn't support the
INSERT statement with the RETURNING option (p. 363)
Resolution
To perform this operation, divide the INSERT statement with the RETURNING clause into an INSERT statement with following SELECT statements and use the same key conditions in each
SELECT. You can also use the last value that was generated by AUTO_INCREMENT column in the key condition.
INTERSECT, EXCEPT
Item
INTERSECT, EXCEPT
Issue
Issue 6612: Query with INTERSECT/EXCEPT
ALL operator was transformed (p. 363)
Resolution
Perform a manual conversion.
Version 1.0
348
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
LABEL
Item
LABEL
Issue
Issue 6344: MySQL doesn't support labeled variables (p. 364)
Resolution
Try rewriting variables without using labels.
LIMIT
Item
LIMIT, OFFSET
Issue
Issue 6611: LIMIT/OFFSET option was omitted (p. 364)
Materialized Views
Item
CREATE
MATERIALIZED VIEW
Issue
Resolution
Perform a manual conversion.
Resolution
If this migration approach is unsuitable for any reason, perform a manual conversion.
Message from Stored Routines
Item
RAISE DEBUG|
LOG|INFO|NOTICE|
WARNING
Issue
Issue 6332: MySQL doesn't support the RAISE statement to report messages (p. 365)
Resolution
Try using INSERT in the log table. To do this, you must add code into
AWS_POSTGRESQL_EXT.RAISE_DEBUG,
AWS_POSTGRESQL_EXT.RAISE_LOG,
AWS_POSTGRESQL_EXT.RAISE_INFO,
AWS_POSTGRESQL_EXT.RAISE_NOTICE, and
AWS_POSTGRESQL_EXT.RAISE_WARNING.
Operators and Date Functions
Item Issue
Date/Time Operators
Date/Time Operators
Issue 6661: The operation will return the number of days instead of the interval value (p. 365)
Date/Time Operators
Issue 6662: Unsupported format for the interval's value (p. 366)
Version 1.0
349
Resolution
Perform a manual conversion.
Check if the resulting type meets your requirements. If it doesn't, perform a manual conversion.
Currently, the only supported format is a SQL ANSI format
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Item Issue
Patterns
Item
SIMILAR TO
Issue
Issue 6607: Could not convert pattern to MySQL version; check pattern manually (p. 367)
ROW/RECORD Type
Item
ROW()
ROW/RECORD
Issue
Issue 6606: MySQL doesn't support
ROW() function with any, some, or all predicates (p. 367)
Issue 6668: MySQL doesn't support ROW/
Select
Item
DISTINCT ON
Issue
Version 1.0
350
Resolution
for interval literals. Perform a manual conversion.
ORDER BY
Item
NULLS FIRST|LAST
USING
Issue
Issue 6610: AI nulls first/last transformation was performed (p. 366)
Issue 6609: ORDER option was omitted because MySQL doesn't support key word
USING in order by clause (p. 366)
Resolution
Perform a manual conversion.
Perform a manual conversion.
Parser Error
Item
Parser Error
Issue
Issue 6663: Unable to resolve the object (p. 366)
Resolution
Verify if object %s is present in the database. If it isn't, check the object name or add the object. If the object is present, transform the code manually.
Resolution
Perform a manual conversion.
Resolution
Perform a manual conversion.
Perform a manual conversion.
Resolution
Perform a manual conversion.
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Item
ONLY | *
DateTime
Issue
Issue 6679: Value don't fixed on start transaction (p. 367)
Resolution
Perform a manual conversion.
Review your code, and if needed use a local variable
SELECT INTO
Item
SELECT INTO
Issue
Issue 6666: Transformation of not strict into clause was performed (p. 367)
Resolution
Perform a manual conversion.
SELECT, UPDATE, INSERT, DELETE
Item
WITH
Issue
Issue 6127: MySQL doesn't support the WITH
Resolution
Use a stored procedure to prepare data, or rewrite your query to avoid the WITH clause.
Sequences
Item
CREATE SEQUENCE,
ALTER SEQUENCE,
DROP SEQUENCE
Issue
Issue 6060: MySQL doesn't support sequences (p. 368)
Resolution
Perform a manual conversion.
SQL Functions
Item
COLLATION
Issue
Issue 6343: MySQL doesn't support the
COLLATE option; automatic conversion cannot be performed (p. 368)
Resolution
You must use the COLLATION settings that were assigned when the database was created.
Table Columns
Item
Application data types: CIDR, INET,
MACADDR, UUID,
XML, JSON, JSONB,
TSVECTOR, TSQUERY
Issue
Issue 6006: MySQL doesn't support %s type (p. 368)
Version 1.0
351
Resolution
Check the target data type and correct it if inappropriate.
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Item
ARRAY
CIRCLE
DECIMAL types
INTERVAL
LINE
Range types
Serial types:
BIGSERIAL /
SERIAL8 /
SERIAL / SERIAL4 /
SMALLSERIAL /
SERIAL2
TIME WITH TIME
ZONE
Timestamps with time zone
Issue
Issue 6008: MySQL doesn't support array types for table column definition (p. 369)
Issue 6011: MySQL doesn't support CIRCLE as a spatial type; the approximated results of
BUFFER function of POLYGON data type is used to perform a conversion (p. 369)
Issue 6005: MySQL doesn't support INTERVAL type (p. 369)
Resolution
Perform a manual conversion.
If the approximated representation is not suitable for any reason, perform a manual conversion.
Check, if the data violates these restrictions. If so, perform a manual migration.
Perform a manual conversion.
If the two-pointed representation is not suitable for any reason, perform a manual conversion.
Perform a manual conversion.
Issue 6009: MySQL doesn't support range types (p. 369)
Issue 6001: Unable to provide full migration for auto-increment table columns (p. 369)
MySQL supports only one auto-increment column per table and it must be a key. Decide whether the column should be an autoincremented key or not, and if it should, alter it manually.
Perform a manual conversion.
Issue 6003: MySQL doesn't support time zone information for %s type (p. 369)
Issue 6004: MySQL doesn't support time zone information for %s type (p. 369)
Perform a manual conversion.
If the time zone information has no value, you can choose
DATETIME(6) as a target data type. Otherwise, try to convert the data into
TIMESTAMP(6), taking into account the value of time_zone server setting.
Table Columns, Function Arguments, Local Variables
Item
Bit strings
Issue
Issue 6012: Converted bit strings are right-padded by zero bits to full-byte length (p. 370)
Resolution
If the approximated representation is not suitable for any reason, perform a manual conversion.
Version 1.0
352
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Tables
Item
Constraints
Constraints
Constraints
Constraints
Constraints
Constraints
Tables without columns
Typed tables
Typed tables
Typed tables
Issue
Issue 6111: MySQL doesn't support deferrable constraints (p. 370)
Issue 6112: MySQL doesn't support exclusion constraints (p. 370)
Issue 6114: MySQL doesn't support SET
DEFAULT as a referential action in foreign keys (p. 370)
Resolution
Check your schema and ensure that non-deferrable constraints can provide the necessary level of integrity.
Otherwise, perform a manual conversion on the constraints.
Perform a manual conversion of the exclusion constraint to provide the same level of data integrity.
If the approach with triggers is unsuitable, perform a manual conversion of the check constraint to provide the same level of data integrity.
Check that SET NULL is an appropriate referential action, otherwise perform a manual conversion of the constraint.
Right now, explicitly inserted NULL values are not distinguished from those specially omitted to use default values. Also, updating values to DEFAULT is not supported at the present time. If you need that functionality, perform a manual conversion.
Due to the transformation of the DEFAULT constraint based on an expression into the part of a trigger, the NOT
NULL constraint is converted as another part of the same trigger.
Perform a manual conversion.
Issue 6110: MySQL doesn't support tables without columns (p. 371)
Issue 6107: MySQL doesn't support unlogged tables (p. 371)
Issue 6108: MySQL doesn't support inherited tables (p. 371)
Issue 6109: MySQL doesn't support typed tables (p. 372)
If a regular table is unsuitable, perform a manual conversion.
Perform a manual conversion.
Perform a manual conversion.
Version 1.0
353
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Triggers
Item
Conditional triggers
Constraint triggers
Disabled triggers
DROP TRIGGER
Instead-of triggers
Multiple triggers on the same event
One trigger on multiple events
Statement-level triggers
Trigger functions
Trigger functions
Trigger functions
Trigger on TRUNCATE event
Issue
Issue 6082: MySQL doesn't support constraint triggers (p. 372)
Resolution
If a resulting trigger must fire for updates of only the particular column(s), perform a manual conversion.
Perform a manual conversion.
Issue 6087: MySQL doesn't support disabling triggers (p. 372)
Issue 6086: Unable to automatically transform dropping a trigger (p. 372)
Issue 6084: MySQL doesn't support INSTEAD
Issue 6080: MySQL doesn't support statement-level triggers (p. 374)
Issue 6650: Unable to convert the statement with TG_ARGV automatically (p. 374)
Issue 6088: MySQL doesn't support
TRUNCATE event for triggers (p. 374)
Perform a manual conversion.
Perform a manual conversion.
Perform a manual conversion.
If a result of merging is unappropriate, perform a manual conversion.
If this migration approach is not suitable for the trigger, perform a manual conversion.
Perform a manual conversion.
Perform a manual conversion.
Check flow of execution and perform a manual conversion if necessary.
Check, if NULL instead of a field of the unsupported record is appropriate.
Perform a manual conversion.
UDT
Item
CREATE TYPE, ALTER
TYPE, DROP TYPE
Issue
Issue 6120: MySQL doesn't support userdefined data types (p. 374)
Resolution
Perform a manual conversion.
Version 1.0
354
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Unknown
Item
Unknown
UPDATE
Item
FROM
RETURNING
Issue
Issue 6669: FROM clause was rewritten (p. 375)
Issue 6066: MySQL doesn't support the
UPDATE statement with the RETURNING option (p. 375)
WHERE CURRENT OF
Issue 6670: MySQL does not support update by cursor (p. 375)
Resolution
Perform a manual conversion.
To perform this operation, divide the UPDATE statement with the RETURNING clause into an UPDATE statement with following INSERT statements that have the specified key conditions in the
SELECT part.
Perform a manual conversion.
User-Defined Aggregate Functions
Item
CREATE AGGREGATE,
ALTER AGREGGATE,
DROP AGREGGATE
Issue
Issue 6140: Unable to convert user-defined aggregate statements (p. 376)
Resolution
Perform a manual conversion.
VIEW
Item
QUERY
Issue
Issue 6013: This syntactic element conversion is not supported yet (p. 375)
Resolution
Perform a manual conversion.
Issue
Issue 6076: The SELECT statement cannot contain a subquery in the FROM clause (p. 376)
Resolution
Rewrite the view query without a subquery, or create an auxiliary table for the subquery.
Views
Item
Default values for the view's columns
Issue
Issue 6072: MySQL doesn't support default values for the view's column (p. 376)
Resolution
If the same functionality is necessary, perform a manual conversion.
Version 1.0
355
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Item
Row-level secured views
Temporary views
Issue
Issue 6071: MySQL doesn't support row-level security (p. 376)
Issue 6070: MySQL doesn't support temporary views or views on temporary tables (p. 376)
Resolution
If the same functionality is necessary, perform a manual conversion.
Perform a manual conversion.
Conversion Issues with AGGREGATE FUNCTION
Issue 6680: Check working of function with null values
Perform a manual conversion.
Issue 6678: MySQL doesn't support function %s with OVER/ORDER BY/WITHIN
GROUP/FILTER clause
Perform a manual conversion.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with ALTER
Issue 6676: Automatic conversion of the ALTER statement isn't supported
Perform a manual conversion.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Arithmetic Operators
Issue 6681: Unable to perform an automated migration of arithmetic operations with string and other types
Arithmetic operations that use a string type as one of the operands can't be automatically converted.
Modify the code to cast values as the intended type.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
Version 1.0
356
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with ARRAY
Issue 6608: MySQL doesn't support arrays
Perform a manual conversion.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Buildin Function
Issue 6677: MySQL does not support time zone
Perform a manual conversion.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Built-In SQL Functions
Issue 6667: MySQL doesn't support the %s function
Create a user-defined function instead.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with CREATE
Issue 6094: Unable to convert object due to %s not created
Review the %s object.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Version 1.0
357
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Conversion Issues with CURSOR
Issue 6639: MySQL doesn't support the direction clause
MySQL doesn't support the following direction clauses when using FETCH with cursors:
• ABSOLUTE 2
• BACKWARD
• FIRST FROM
• FORWARD
• LAST FROM
• PRIOR FROM
• RELATIVE 2
• RELATIVE 3
Perform a manual conversion in these cases.
Issue 6640: MySQL doesn't support the MOVE option
Revise your code to eliminate cursors with the MOVE option.
Issue 6638: MySQL doesn't support the SCROLL option in cursors
Revise your code to eliminate cursors with the SCROLL option.
Issue 6337: MySQL doesn't support a variable of REFCURSOR type
Try revising the code to use temporary tables instead.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Databases
Issue 6101: MySQL doesn't support this clause in an ALTER DATABASE statement
Perform a manual conversion.
Issue 6100: The database-to-database migration is not provided
Use the schema-to-database migration plan instead.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Version 1.0
358
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Conversion Issues with DATA TYPES
Issue 6673: MySQL doesn't support %s type in the CAST function, and a loss of precision or accuracy of data is possible
Statements that cast values to any of the following data types are converted to statements that cast values to CHAR:
• BYTEA
• CIDR
• JSON
• int4range
For example, take the following PostgreSQL statements.
select '1'::BYTEA select CAST('1' AS BYTEA)
These are both converted to the following MySQL statement.
select CAST('1' AS CHAR)
Review the converted code and revise it if necessary.
Issue 6674: MySQL doesn't support %s type in the CAST function
Statements that cast a value to the TXID_SNAPSHOT data type are converted to statements that cast a value to CHAR. For example, take the following PostgreSQL statements.
select '2628:2628:'::TXID_SNAPSHOT select CAST('2628:2628:' AS TXID_SNAPSHOT)
These are both converted to the following MySQL statement: select CAST('2628:2628:' AS CHAR)
Review the converted code and revise it if necessary.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with DELETE
Issue 6069: MySQL doesn't support the DELETE statement with the RETURNING option
To convert this operation, change the DELETE statement with the RETURNING clause into a DELETE statement with following INSERT statements, and use the same key conditions in each INSERT.
Version 1.0
359
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Issue 6672: MySQL does not support delete by cursor
MySQL doesn't support using a DELETE statement within a cursor. Perform a manual conversion in this case.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Domains
Issue 6050: MySQL doesn't support domains
Perform a manual conversion.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Dynamic SQL
Issue 6334: MySQL doesn't support the dynamic SQL statement RETURN QUERY
EXECUTE
Review and modify the execution string.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Error Handling
Issue 6665: MySQL doesn't support the GET [ CURRENT ] DIAGNOSTICS command
Perform a manual conversion.
Issue 6664: MySQL doesn't support the condition information %s
Some of the condition information items that are used with the GET STACKED DIAGNOSTICS statement in PostgreSQL are not supported by MySQL. These include the following:
• PG_DATATYPE_NAME
• TABLE_NAME
• SCHEMA_NAME
Version 1.0
360
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
• PG_EXCEPTION_DETAIL
• PG_EXCEPTION_HINT
• PG_EXCEPTION_CONTEXT
Manually convert the code wherever you use these condition information items.
Issue 6329: MySQL doesn't support the RAISE exception
Review the RAISE exception used, and if possible convert it to an exception using the SIGNAL or
RESIGNAL statement.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Exceptions
Issue 6342: MySQL doesn't support the %s condition name
Review the exception used, and if possible convert it to an exception using the SIGNAL or RESIGNAL statement.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with FROM
Issue 6603: Can't use function in from clause
Code that selects from a function, for example
SELECT * FROM function_name;
, isn't converted. Perform a manual conversion in this case.
Issue 6682: Can't use the table-value function in the from clause
MySQL does not support the table-value function. Perform a manual conversion in this case.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with FUNCTION
Issue 6675: Automatic conversion function on %s language isn't supported
Perform a manual conversion.
Version 1.0
361
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Issue 6613: Unable to convert a function without OUT parameters returning a
RECORD type
Perform a manual conversion.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Functions
Issue 6604: MySQL doesn't support RETURN NEXT clause
Perform a manual conversion.
Issue 6605: MySQL doesn't support VARIADIC mode of an argument
Perform a manual conversion.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Indexes
Issue 6091: MySQL doesn't support %s index method
The InnoDB engine in MySQL doesn't support HASH and ON table_name indexes. Perform a manual conversion in these cases.
Issue 6090: MySQL doesn't support indexes on expressions
Perform a manual conversion.
Issue 6092: MySQL doesn't support explicit sort ordering in the index definition
Indexes that use explicit sort ordering are converted to use the default (ascending) sort order instead. If this conversion causes performance degradation, revise the converted code as necessary.
Issue 6093: MySQL doesn't support partial indexes
Partial indexes are converted to full indexes instead. For example, take the following PostgreSQL statement.
CREATE INDEX i_indexed_partial
ON test_pg_mysql.indexed_partial USING btree
( n )
Version 1.0
362
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
WHERE ( n < 100 );
The preceding statement is converted to the following MySQL statement:
CREATE INDEX i_indexed_partial
USING BTREE ON test_pg_mysql.indexed_partial
( n );
If this conversion causes performance degradation, revise the converted code as necessary.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with INSERT
Issue 6172: MySQL doesn't support the INSERT statement with the RETURNING option
To convert this operation, change the INSERT statement with the RETURNING clause into an INSERT statement with following SELECT statements, and use the same key conditions in each SELECT. You can also use the last value that was generated by any AUTO_INCREMENT column in the key condition.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with INTERSECT, EXCEPT
Issue 6612: Query with INTERSECT/EXCEPT ALL operator was transformed
The EXCEPT ALL and INTERSECT ALL options of the SELECT statement can't be directly converted, so they are converted to other language options that should produce the same results. For example, take the following PostgreSQL statements.
SELECT * FROM customers except all
SELECT * FROM customers;
SELECT * FROM customers intersect all
SELECT * FROM customers;
The preceding statements are converted to the following MySQL statements.
SELECT customers.id, customers.name, customers.surname, customers.postcode FROM customers where (customers.id, customers.name, customers.surname, customers.postcode)
Version 1.0
363
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference not in (SELECT customers.id, customers.name, customers.surname, customers.postcode FROM
customers);
SELECT customers.id, customers.name, customers.surname, customers.postcode
FROM customers inner join (SELECT customers.id, customers.name, customers.surname,
customers.postcode FROM customers) nn on (customers.id=nn.id or (customers.id is null and nn.id is null))
and customers.name=nn.name
and (customers.surname=nn.surname or (customers.surname is null and nn.surname is null))
and (customers.postcode=nn.postcode or (customers.postcode is null and nn.postcode is
null));
Review the converted code, and revise it if necessary.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with LABEL
Issue 6344: MySQL doesn't support labeled variables
Try rewriting variables without using labels.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with LIMIT
Issue 6611: LIMIT/OFFSET option was omitted
MySQL doesn't support use of the LIMIT or OFFSET options with the SELECT statement. These options are dropped during conversion. For example, take the following PostgreSQL statement.
SELECT * FROM customers c offset 3;
This statement is converted to the following MySQL statement:
SELECT * FROM customers c;
Review the converted code, and revise it as necessary.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
Version 1.0
364
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Materialized Views
Issue 6130: MySQL doesn't support materialized views; the source materialized view is converted to a table with triggers
Review the converted code to make sure it meets your needs, and revise it if necessary.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Messages from Stored Routines
Issue 6332: MySQL doesn't support the RAISE statement to report messages
Try using INSERT to write a message to a log table instead. To do this, you must add code in one of the following tables in the AWS_POSTGRESQL_EXT schema (the temporary work schema used for
PostgreSQL):
• RAISE_DEBUG
• RAISE_LOG
• RAISE_INFO
• RAISE_NOTICE
• RAISE_WARNING
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Operators and Date Functions
Issue 6660: Unable to convert the %s operation with the interval value as one or more arguments
Some operations with arguments that use an interval data type can't be converted, for example
SELECT
INTERVAL '1-1' YEAR TO MONTH * 2;
. Perform a manual conversion in this case.
Issue 6661: The operation will return the number of days instead of the interval value
After conversion, some calculations that use date or time data types return the number of days rather than an interval value as they did previously, for example
SELECT TIMESTAMP '2012-01-01 09:30:15.01'
- DATE '2010-01-01';
. Check to see if the new return type meets your requirements, and revise the code if necessary.
Version 1.0
365
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Issue 6662: Unsupported format for the interval's value
Currently, the only supported format for a literal value assigned to an interval data type is SQL ANSI.
Perform a manual conversion in the case of an unsupported format.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with ORDER BY
Issue 6610: AI nulls first/last transformation was performed
MySQL doesn't support the NULLS FIRST or NULLS LAST options with the SELECT statement. Instances of this language are converted to use the isnull() function instead. For example, take the following
PostgreSQL statements.
SELECT * FROM customers c order by id nulls last;
SELECT * FROM customers c order by id desc nulls first;
These statements are converted to the following MySQL statements.
SELECT * FROM customers c order by isnull(id), id;
SELECT * FROM customers c order by isnull(id) desc, id desc;
Review the converted code, and revise it if necessary.
Issue 6609: ORDER option was omitted because MySQL doesn't support key word USING in order by clause
MySQL doesn't support the ORDER BY field_name USING clause, for example
SELECT * FROM customers c order by id using >;
. During conversion, the ORDER BY clause is dropped. Review this code and revise it if necessary.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Parser Error
Issue 6663: Unable to resolve the object
Verify if object %s is present in the database. If it isn't, check the object name or add the object. If the object is present, transform the code manually.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
Version 1.0
366
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Patterns
Issue 6607: Could not convert pattern to MySQL version; check pattern manually
MySQL doesn't support some pattern matching syntax, for example
SELECT * FROM customers where name similar to 'name';
. Perform a manual conversion in this case.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with ROW, RECORD type
Issue 6606: MySQL doesn't support ROW() function with any, some, or all predicates
MySQL doesn't support the ROW() function with the any, some, or all predicates, for example
SELECT *
FROM customers c where ROW(c.id, c.postcode) <= all (select id, order_sum from orders where id = c.id);
. Perform a manual conversion instead.
Issue 6668: MySQL doesn't support ROW/RECORD type
Perform a manual conversion.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with SELECT
Issue 6679: Value don't fixed on start transaction
Review your code, and revise it to use a local variable if necessary.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with SELECT INTO
Issue 6666: Transformation of not strict into clause was performed
Perform a manual conversion.
Version 1.0
367
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with SELECT, UPDATE, INSERT, DELETE
Issue 6127: MySQL doesn't support the WITH RECURSIVE clause
Use a stored procedure to prepare data, or rewrite your query to avoid the WITH RECURSIVE clause.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Sequences
Issue 6060: MySQL doesn't support sequences
Perform a manual conversion.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with SQL Functions
Issue 6343: MySQL doesn't support the COLLATE option; automatic conversion cannot be performed
You must use the COLLATION settings that were assigned when the database was created.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Table Columns
Issue 6006: MySQL doesn't support %s type
Check the target data type and correct it if necessary.
Version 1.0
368
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Issue 6008: MySQL doesn't support array types for table column definition
MySQL doesn't support using an array data type for either a table column or a function variable, so this code isn't automatically converted from PostgreSQL. Perform a manual conversion instead.
Issue 6011: MySQL doesn't support CIRCLE as a spatial type; the approximated results of BUFFER function of POLYGON data type is used to perform a conversion
Check the converted code, and revise it if the approximated representation doesn't meet your needs.
Issue 6002: MySQL doesn't support %s with precision more than 65 digits and scale more than 30 digits; the loss of precision or accuracy of data is possible
Check to see if you are converting columns whose numeric data types violate these restrictions. If so, perform a manual migration instead.
Issue 6005: MySQL doesn't support INTERVAL type
Perform a manual conversion of any code that uses this data type.
Issue 6010: MySQL doesn't support infinite lines; a LINESTRING with two points on the line is used for conversion
Any instance of the LINE data type is converted to a LINESTRING data type. If the two-pointed representation is not suitable for your purposes, revise this code.
Issue 6009: MySQL doesn't support range types
MySQL doesn't support range data types like LONGTEXT or VARCHAR(length). Manually convert code that uses these data types instead.
Issue 6001: Unable to provide full migration for auto-increment table columns
The PostgreSQL auto-increment data types SMALLSERIAL, SERIAL and BIGSERIAL are converted to the
MySQL SMALLINT, INT, and BIGINT data types, respectively. If you want to enable auto-incrementing,
MySQL supports only one auto-increment column per table and it must be a key. Choose an appropriate column and manually update it to meet these requirements.
Issue 6003: MySQL doesn't support time zone information for %s type
Perform a manual conversion.
Issue 6004: MySQL doesn't support time zone information for %s type
Perform a manual conversion instead. If the time zone information isn't important, you can choose
DATETIME(6) as a target data type. Otherwise, try to convert the data into TIMESTAMP(6), taking into account the value of time_zone server setting.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Version 1.0
369
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Conversion Issues with Table Columns, Function Arguments, and
Local Variables
Issue 6012: Converted bit strings are right-padded by zero bits to full-byte length
Review the converted code, and revise it if the approximated representation is not suitable for your needs.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Tables
Issue 6111: MySQL doesn't support deferrable constraints
Check your schema and ensure that nondeferrable constraints can provide the necessary level of integrity. Otherwise, perform a manual conversion on the constraints.
Issue 6112: MySQL doesn't support exclusion constraints
Perform a manual conversion of the exclusion constraint to provide the same level of data integrity.
Issue 6113: MySQL doesn't support check constraints; the source constraint is converted to a conditional error raising in triggers
In MySQL, check constraints are parsed but ignored. Instead, PostgreSQL check constraints are converted to triggers that fire before INSERT and UPDATE events. Review this code to see if it meets your needs, and if necessary perform a manual conversion of the check constraint to provide the expected level of data integrity.
Issue 6114: MySQL doesn't support SET DEFAULT as a referential action in foreign keys
MySQL doesn't support using SET DEFAULT when creating a foreign key. Any SET DEFAULT statements are converted to SET NULL statements. Review this code and modify it if necessary.
Issue 6115: MySQL doesn't support expressions in DEFAULT constraints, so they are converted to a BEFORE INSERT trigger
MySQL doesn’t support using expressions as default values when creating a table, so during conversion a
BEFORE INSERT trigger is created to insert the default values instead. CHARACTER VARYING columns are converted into TEXT or LONGTEXT columns (depending on the length of the source column), which can't have default values in MySQL. Therefore, any default values in such columns are treated as expressions and are also included in the BEFORE INSERT trigger.
For example, take the following PostgreSQL code.
CREATE TABLE IF NOT EXISTS test_pg_mysql.constraint_default_expression
Version 1.0
370
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
( n numeric( 10, 0 ) DEFAULT 12345+98765
, d date DEFAULT now()
, d2 date DEFAULT '2016-01-06'::date
, s character varying (10) DEFAULT 'A string'
);
This code is converted into the following MySQL code.
CREATE TRIGGER constraint_default_expression_bir
BEFORE INSERT
ON test_pg_mysql.constraint_default_expression
FOR EACH ROW
BEGIN
default_values_expr: BEGIN
-- default value for n column
IF NEW.n IS NULL THEN
SET NEW.n = 123456 + 98765;
END IF;
-- default value for d column
IF NEW.d IS NULL THEN
SET NEW.d = now( 6 );
END IF;
-- default value for d2 column
IF NEW.d2 IS NULL THEN
SET NEW.d2 = CAST( '2016-01-06' AS DATE );
END IF;
-- default value for s column
IF NEW.s IS NULL THEN
SET NEW.s = 'A string';
END IF;
END default_values_expr;
END;
Issue 6117: Unable to keep the NOT NULL constraint for %s column while converting its DEFAULT constraint based on an expression
MySQL doesn’t support using expressions as default values when creating a table, so during conversion a BEFORE INSERT trigger is created to insert the default values instead. For more details, see
.
If a column that has a default value and so is converted in this way also has a NOT NULL constraint, the NOT NULL constraint is converted as part of the same trigger rather than remaining as part of the
CREATE TABLE statement.
Issue 6110: MySQL doesn't support tables without columns
MySQL doesn't support using the CREATE TABLE statement without specifying at least one column.
This usage is something you might do when creating a table based on a user-defined type, for example.
Perform a manual conversion instead.
Issue 6107: MySQL doesn't support unlogged tables
Unlogged tables in PostgreSQL are converted to regular tables in MySQL. Review this code to see if it meets your needs, and revise it if necessary.
Issue 6108: MySQL doesn't support inherited tables
Perform a manual conversion.
Version 1.0
371
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Issue 6109: MySQL doesn't support typed tables
Perform a manual conversion.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Triggers
Issue 6083: MySQL doesn't support conditional triggers that fire on updates of particular column(s); a conversion will omit such a condition
MySQL doesn't support conditional triggers that rely on the update of a specific column. For example, take the following statement in PostgreSQL.
CREATE TRIGGER triggering_cond_bur_of
BEFORE UPDATE OF n
This statement is converted to the following statement in MySQL:
CREATE TRIGGER triggering_cond_bur
BEFORE UPDATE
If you require this functionality, perform a manual conversion instead.
Issue 6082: MySQL doesn't support constraint triggers
MySQL doesn't support constraint triggers, so any CREATE CONSTRAINT TRIGGER statements are converted to CREATE TRIGGER statements. Review this code and modify it if necessary.
Issue 6087: MySQL doesn't support disabling triggers
PostgreSQL allows users to disable table triggers so that they aren't fired, and then re-enable them at a later time. MySQL doesn’t support this, so you must perform a manual conversion of this code.
Issue 6086: Unable to automatically transform dropping a trigger
DROP TRIGGER statements aren't automatically converted. Perform a manual conversion instead.
Issue 6084: MySQL doesn't support INSTEAD OF triggers
Perform a manual conversion.
Issue 6085: MySQL doesn't support multiple triggers on the same event; triggers are merged into one in alphabetical order by trigger name
Multiple triggers on one event are automatically merged into a single trigger, with their functionality inserted into the new trigger in alphabetic order by trigger name. Review this trigger code after conversion and revise it if necessary.
For example, take the following PostgreSQL code.
Version 1.0
372
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
CREATE TRIGGER triggering_multiple_inc
BEFORE INSERT
ON test_pg_mysql.triggering_multiple
FOR EACH ROW
EXECUTE PROCEDURE test_pg_mysql.fu_triggering_simple_inc();
CREATE TRIGGER triggering_multiple_inc_2
BEFORE INSERT
ON test_pg_mysql.triggering_multiple
FOR EACH ROW
EXECUTE PROCEDURE test_pg_mysql.fu_triggering_simple_inc();
This code is converted into the following MySQL code.
CREATE TRIGGER triggering_multiple_bir
BEFORE INSERT
ON test_pg_mysql.triggering_multiple
FOR EACH ROW
BEGIN
tr1: BEGIN
-- triggering_multiple_inc
SET NEW.n = NEW.n + 1;
END tr1;
tr2: BEGIN
-- triggering_multiple_inc_2
SET NEW.n = NEW.n + 1;
END tr2;
END;
Issue 6081: MySQL doesn't support triggers firing on multiple events; such a trigger is converted to multiple single-event triggers with the same body
PostgreSQL supports specifying multiple events with the CREATE TRIGGER statement, for example
CREATE TRIGGER trigger_name BEFORE INSERT OR UPDATE. However, MySQL only supports specifying one event, for example CREATE TRIGGER trigger_name BEFORE UPDATE. PostgreSQL triggers that specify multiple events are converted to several triggers with the same trigger body, one for each event specified. Review this trigger code after conversion and revise it if necessary.
For example, take the following PostgreSQL code.
CREATE TRIGGER
triggering_simple_inc BEFORE INSERT
OR UPDATE ON
test_pg_mysql.triggering_simple FOR EACH
ROW EXECUTE PROCEDURE
test_pg_mysql.fu_triggering_simple_inc();
This code is converted into the following MySQL code:
CREATE TRIGGER triggering_simple_bir
BEFORE INSERT
ON test_pg_mysql.triggering_simple
FOR EACH ROW
BEGIN
tr1: BEGIN
SET NEW.n = NEW.n + 1;
END tr1;
END;
Version 1.0
373
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
CREATE TRIGGER triggering_simple_bur
BEFORE UPDATE
ON test_pg_mysql.triggering_simple
FOR EACH ROW
BEGIN
tr1: BEGIN
SET NEW.n = NEW.n + 1;
END tr1;
END;
Issue 6080: MySQL doesn't support statement-level triggers
MySQL doesn't support the FOR EACH STATEMENT clause for CREATE TRIGGER statements. Perform a manual conversion of this code.
Issue 6650: Unable to convert the statement with TG_ARGV automatically
CREATE TRIGGER statements that use TG_ARGV to work with trigger arguments can't be converted.
Perform a manual conversion instead.
Issue 6651: Unsupported using of RETURN statement in the trigger converted to
LEAVE statement
Check flow of execution and perform a manual conversion if necessary.
Issue 6652: MySQL doesn't support OLD record in triggers on INSERT or NEW record in triggers on DELETE
MySQL doesn’t support the NEW variable in triggers that use DELETE, and it also doesn't support the
OLD variable in triggers that use INSERT. In these cases, the variable reference is replaced with NULL For example,
NEW.n > 0
is replaced by
NULL > 0
. Review this code to see if using NULL instead of a field of the unsupported record is appropriate, and revise as necessary.
Issue 6088: MySQL doesn't support TRUNCATE event for triggers
Perform a manual conversion.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with User-Defined Types
Issue 6120: MySQL doesn't support user-defined data types
Perform a manual conversion of any code involving user-defined types. This conversion should include any references to user-defined types, and also any instances of the CREATE TYPE, ALTER TYPE, or DROP
TYPE statements.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
Version 1.0
374
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Unknown
Issue 6013: This syntactic element conversion is not supported yet
Perform a manual conversion.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with UPDATE
Issue 6669: FROM clause was rewritten
The FROM clause in UPDATE statements is rewritten during PostgreSQL to MySQL conversion. For example, take the following PostgreSQL statement.
update test_pg_mysql.customers c set id = c.id +1, name = o.name,
postcode = o.order_sum from test_pg_mysql.orders o where o.id = c.id;
This statement is converted to the following MySQL statement.
update customers c
set id = c.id +1,
name = (select name from orders where id = c.id),
postcode = (select order_sum from orders where id = c.id)
where c.id in (select id from orders);
Review this code to make sure it produces the results that you expect.
Issue 6066: MySQL doesn't support the UPDATE statement with the RETURNING option
To perform this operation, convert the UPDATE statement with the RETURNING clause into an UPDATE statement with following INSERT statements that have the specified key conditions in the SELECT clause.
Issue 6670: MySQL does not support update by cursor
MySQL doesn't support updating a table from within a cursor, as shown in the following example.
DECLARE c1 CURSOR FOR SELECT id FROM test_pg_mysql.customers;
val numeric(14,0);
BEGIN
OPEN c1;
fetch c1 into val;
update test_pg_mysql.customers set name = 'nfhr' where current of c1;
CLOSE c1;
END
Perform a manual conversion instead.
Version 1.0
375
AWS Schema Conversion Tool User Guide
PostgreSQL to MySQL Conversion Reference
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with User-Defined Aggregate Functions
Issue 6140: Unable to convert user-defined aggregate statements
Perform a manual conversion of any user-defined aggregate functions.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with VIEW
Issue 6076: The SELECT statement cannot contain a subquery in the FROM clause
Either rewrite the query that the view is based on so that it doesn't use a subquery, or create an auxiliary table for the subquery.
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Conversion Issues with Views
Issue 6072: MySQL doesn't support default values for the view's column
MySQL doesn't support specifying a default value when creating or altering a view, as shown in the following example.
ALTER VIEW test_pg_mysql.v_default_values
ALTER n SET DEFAULT 10;
If you need this functionality, perform a manual conversion instead.
Issue 6071: MySQL doesn't support row-level security
If the same functionality is necessary, perform a manual conversion instead.
Issue 6070: MySQL doesn't support temporary views or views on temporary tables
Perform a manual conversion instead.
Version 1.0
376
AWS Schema Conversion Tool User Guide
Related Topics
Related Topics
•
PostgreSQL to MySQL Conversion Reference (p. 344)
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Related Topics
•
AWS Schema Conversion Tool Reference (p. 139)
•
What Is the AWS Schema Conversion Tool? (p. 1)
Related Topics
•
What Is the AWS Schema Conversion Tool? (p. 1)
•
Getting Started with the AWS Schema Conversion Tool (p. 11)
•
Installing and Updating the AWS Schema Conversion Tool (p. 6)
Version 1.0
377
AWS Schema Conversion Tool User Guide
Document History
The following table describes the important changes to the documentation since the last release of the
AWS Schema Conversion Tool (AWS SCT) User Guide.
•
Version: 1.0.602
• Latest documentation update: May 11, 2017
Change
Data extraction agents support additional data warehouses
Description
You can now use data extraction agents to extract data from your Microsoft SQL Server data warehouses.
For more information, see
.
Data extraction agents can copy data to Amazon
Redshift
AWS SCT supports additional data warehouses
Data extraction agents support additional data warehouses
Data extraction agents support additional operating systems
Data extraction agents now have three upload modes.
You can now specify whether to just extract your data, to extract your data and just upload it to Amazon S3, or to extract, upload, and copy your data directly into Amazon
Redshift. For more information, see
You can now use the AWS Schema Conversion Tool to convert your Vertica and Microsoft SQL Server schemas to equivalent Amazon Redshift schemas. For more information, see
Converting Data Warehouse Schema to
Amazon Redshift by Using the AWS Schema Conversion
You can now use data extraction agents to extract data from your Greenplum, Netezza, and Vertica data
warehouses. For more information, see Using Data
.
You can now install data extraction agents on computers running the macOS and Microsoft Windows operating systems. For more information, see
.
Date Changed
May 11, 2017
May 11, 2017
April 18, 2017
April 18, 2017
April 18, 2017
Version 1.0
378
AWS Schema Conversion Tool User Guide
Change
Amazon Aurora with PostgreSQL compatibility as a target database
Description
Data extraction agents upload to Amazon S3 automatically
Data Extraction
Agents
Data extraction agents now upload your extracted data to Amazon S3 automatically. For more information, see
Extraction Task Output (p. 116) .
You can now install data extraction agents that extract data from your data warehouse and prepare it for use with Amazon Redshift. You can use the AWS Schema
Conversion Tool to register the agents and create data extraction tasks for them. For more information, see
Using Data Extraction Agents (p. 110)
.
Customer Feedback You can now provide feedback about the AWS Schema
Conversion Tool. You can file a bug report, you can submit a feature request, or you can provide general
information. For more information, see Providing
.
Integration with
AWS DMS
You can now use the AWS Schema Conversion Tool to create AWS DMS endpoints and tasks. You can run and monitor the tasks from AWS SCT. For more information,
see Working with the AWS Database Migration Service
Using the AWS Schema Conversion Tool (p. 121)
.
The AWS Schema Conversion Tool now supports Amazon
Aurora with PostgreSQL compatibility as a target database. For more information, see
Schema to Amazon RDS by Using the AWS Schema
Support for profiles You can now store different profiles in the AWS Schema
Conversion Tool and easily switch between them. For
more information, see Storing AWS Profiles in the AWS
Schema Conversion Tool (p. 131) .
Support for
Greenplum
Database and
Netezza
You can now use the AWS Schema Conversion Tool to convert your data warehouse schemas from Greenplum
Database and Netezza to Amazon Redshift. For more information, see
Converting Data Warehouse Schema to
Amazon Redshift by Using the AWS Schema Conversion
Redshift optimization
Mapping rules
You can now use the AWS Schema Conversion Tool to optimize your Amazon Redshift databases. For more information, see
Optimizing Amazon Redshift by Using the AWS Schema Conversion Tool (p. 119)
.
Before you convert your schema with the AWS Schema
Conversion Tool, you can now set up rules that change the data type of columns, move objects from one schema to another, and change the names of objects. For more information, see
Creating Mapping Rules in the AWS
Schema Conversion Tool (p. 69) .
Date Changed
April 18, 2017
February 16, 2017
February 16, 2017
December 20, 2016
December 20, 2016
December 20, 2016
November 17, 2016
November 17, 2016
October 4, 2016
Version 1.0
379
AWS Schema Conversion Tool User Guide
Change
Move to cloud
Description
You can now use the AWS Schema Conversion Tool to copy your existing on-premises database schema to an
Amazon RDS DB instance running the same engine. You can use this feature to analyze potential cost savings of moving to the cloud and of changing your license type. For more information, see
Assessment Report in the AWS Schema Conversion
Data warehouse schema conversions
Application SQL conversions
New feature
You can now use the AWS Schema Conversion Tool to convert your data warehouse schemas from Oracle and
Teradata to Amazon Redshift. For more information, see
Converting Data Warehouse Schema to Amazon Redshift by Using the AWS Schema Conversion Tool (p. 87)
.
You can now use the AWS Schema Conversion Tool to convert SQL in your C++, C#, Java, or other application code. For more information, see
SQL by Using the AWS Schema Conversion Tool (p. 124)
.
The AWS Schema Conversion Tool now contains an extension pack and a wizard to help you install, create, and configure AWS Lambda functions and Python libraries to provide email, job scheduling, and other
features. For more information, see The AWS Schema
Conversion Tool Extension Pack and AWS Services for
Tool Extension Pack and Python Libraries for Data
.
New feature
New feature
You can now use Secure Sockets Layer (SSL) to connect to your source database when you use the AWS Schema
Conversion Tool. For more information, see
Your Source Database (p. 13) .
Adds support for MySQL and PostgreSQL as source databases for conversions.
Maintenance release Adds support for editing the converted SQL that was generated for the target database engine. Adds improved selection capabilities in the source database and target
DB instance tree views. Adds support for connecting to an Oracle source database using Transparent Network
Substrate (TNS) names.
Maintenance release Adds support for PostgreSQL as a target database engine.
Adds the ability to generate converted schema as scripts and to save the scripts to files prior to applying the schema to the target DB instance.
Maintenance release Adds offline project capability, the ability to check for new versions, and memory and performance management.
Date Changed
October 4, 2016
July 13, 2016
July 13, 2016
July 13, 2016
May 19, 2016
April 11, 2016
March 2, 2016
January 14, 2016
December 2, 2015
Version 1.0
380
AWS Schema Conversion Tool User Guide
Change Description
Maintenance release Adds the
Create New Database Migration Project
wizard. Adds the ability to save the database migration assessment report as a PDF file.
Preview release Provides the user guide for the AWS Schema Conversion
Tool preview release.
Date Changed
October 19, 2015
October 7, 2015
Version 1.0
381
Download
Advertisement
Key features
Schema conversion from multiple sources to multiple targets
Supports relational OLTP and data warehouse schemas
Provides database migration assessment report
Allows manual schema adjustments
Includes data extraction agents for data warehouse migration
Integrates with AWS DMS for data migration
Includes an extension pack to emulate non-convertible database features
Optimizes Amazon Redshift database for performance
Converts SQL statements from applications
Provides a project-based user interface
Frequently asked questions
It supports MySQL, PostgreSQL, Oracle, Microsoft SQL Server, Amazon Redshift, Greenplum, Netezza, Teradata, and Vertica.
The tool supports converting both relational OLTP and data warehouse schemas.
Yes, the tool includes data extraction agents for data warehouse migration and integrates with AWS DMS for data migration.
The tool includes an extension pack to emulate non-convertible database features using AWS Lambda functions and Python libraries.
Yes, the tool provides recommendations for sort keys and distribution keys to optimize your Amazon Redshift database.