Menu
AWS Schema Conversion Tool
User Guide (Version 1.0)

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.

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 INSERT trigger

CREATE TABLE

Yes

Deferrable constraints

Partial

Issue 6111: MySQL doesn't support deferrable constraints

DROP TABLE

Yes

Expression as default value for column

Partial

Issue 6115: MySQL doesn't support expressions in DEFAULT constraints, so they are converted to a BEFORE INSERT trigger

Issue 6117: Unable to keep the NOT NULL constraint for %s column while converting its DEFAULT constraint based on an expression

Foreign keys

Partial

Issue 6114: MySQL doesn't support SET DEFAULT as a referential action in foreign keys

Not-null columns

Partial

Issue 6117: Unable to keep the NOT NULL constraint for %s column while converting its DEFAULT constraint based on an expression

Primary keys

Yes

Regular tables

Yes

Table inheritance

No

Issue 6108: MySQL doesn't support inherited tables

Tables with check constraints

Partial

Issue 6113: MySQL doesn't support check constraints; the source constraint is converted to a conditional error raising in triggers

Tables with exclusion constraints

Partial

Issue 6112: MySQL doesn't support exclusion constraints

Tables without columns

No

Issue 6109: MySQL doesn't support typed tables

Trigger disablement

No

Issue 6087: MySQL doesn't support disabling triggers

Typed tables

No

Issue 6110: MySQL doesn't support tables without columns

Issue 6120: MySQL doesn't support user-defined data types

Unique keys

Yes

Unlogged tables

No

Issue 6107: MySQL doesn't support unlogged tables

DML

Built-In SQL Functions

Aggregate

Clause Automatically Converted Details

All

Partial

Issue 6667: MySQL doesn't support the %s function

Character

Clause Automatically Converted Details
All

Partial

Issue 6667: MySQL doesn't support the %s function

Conversion

Clause Automatically Converted Details

All

Partial

Issue 6667: MySQL doesn't support the %s function

DateTime

Clause Automatically Converted Details

All

Partial

Issue 6667: MySQL doesn't support the %s function

Numeric

Clause Automatically Converted Details

All

Partial

Issue 6667: MySQL doesn't support the %s function

Other

Clause Automatically Converted Details

All

Partial

Issue 6667: MySQL doesn't support the %s function

Window

Clause Automatically Converted Details

All

No

Issue 6667: MySQL doesn't support the %s function

XML

Clause Automatically Converted Details

All

No

Issue 6667: MySQL doesn't support the %s function

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

Operators and Date Functions

Bit String Operators

Clause Automatically Converted Details

||,&,|,#,~,<<,>>,

Yes

Date/Time Operators

Mathematical Operators

Clause Automatically Converted Details

+,-,*,/,%,^,|/,||/,!,!!,@,&,|,#,~,<<,>>,

Yes

String Operators

Clause Automatically Converted Details

||

Yes

Predicates

SIMILAR Predicate

Clause Automatically Converted Details
SIMILAR

No

Issue 6607: Could not convert pattern to MySQL version; check pattern manually

Boolean Conditions

Clause Automatically Converted Details

All

Yes

Comparison Condition

Clause Automatically Converted Details

'=, <>, <, <=, >, >=

Yes

ANY, SOME, ALL

Yes

Exists Conditions

Clause Automatically Converted Details

EXISTS

Yes

In Conditions

Clause Automatically Converted Details

IN

Yes

Null Conditions

Clause Automatically Converted Details

NULL

Yes

Pattern-Matching Conditions

Clause Automatically Converted Details

All

Yes

Range Conditions

Clause Automatically Converted Details

All

Yes

Set Operators

Text Search Functions and Operators

Clause Automatically Converted Details

EXCEPT

Yes

INTERSECT

Yes

UNION

Yes

Statements

INSERT

Clause Automatically Converted Details

INSERT INTO table DEFAULT VALUES;

Yes

INSERT INTO table query;

Yes

INSERT INTO table VALUES() RETURNING *;

No

Issue 6172: MySQL doesn't support the INSERT statement with the RETURNING option

INSERT INTO table VALUES() RETURNING {output_expression [ AS output_name ] [, ...]};

No

Issue 6172: MySQL doesn't support the INSERT statement with the RETURNING option

INSERT INTO table VALUES();

Yes

INSERT INTO table VALUES({ expression | DEFAULT } [, ...] ),VALUES({ expression | DEFAULT } [, ...] ) [, ...];

Yes

INSERT INTO table VALUES({ expression | DEFAULT } [, ...] );

Yes

INSERT INTO table(array) VALUES({'{' '}[,..]'});

Yes

INSERT INTO table[( column [, ...] )] VALUES();

Yes

WITH RECURSIVE with_query [, ...] UPDATE table_name SET { column_name = { expression | DEFAULT }} [, ...]

No

Issue 6127: MySQL doesn't support the WITH RECURSIVE clause

WITH with_query [, ...] UPDATE table_name SET { column_name = { expression | DEFAULT }} [, ...]

Yes

SELECT

Clause Automatically Converted Details

Add or subtract operators

Yes

EXCEPT [ALL]

Partial

Issue 6612: Query with INTERSECT/EXCEPT ALL operator was transformed

FROM [ONLY] tablename [*]

No

FROM { with_query_name | function_name()}

No

Issue 6603: Can't use function in from clause

FROM {(subquery) [ AS ] alias |(VALUES({ expression | DEFAULT } [, ...])) [ AS ] alias }

Yes

FROM tablename [ [ AS ] alias ]

Yes

GROUP BY

Yes

HAVING

Yes

INTERSECT [ALL]

Partial

Issue 6612: Query with INTERSECT/EXCEPT ALL operator was transformed

LIMIT { count | ALL } OFFSET start { ROW | ROWS }

Partial

Issue 6611: LIMIT/OFFSET option was omitted

OFFSET start { ROW | ROWS } FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY

Partial

Issue 6611: LIMIT/OFFSET option was omitted

ORDER BY [ ASC | DESC | USING operator ] [ NULLS { FIRST | LAST } ] [, ...]

Yes

SELECT {* | expression [ [ AS ] output_name ] [, ...]} FROM table

Yes

SELECT {expression [ [ AS ] output_name ] [, ...]}

Yes

SELECT ALL

Yes

SELECT DISTINCT

Yes

SELECT DISTINCT ON

No

UNION [ALL]

Yes

WHERE (field_name1,…,fieldnameN) IN (subquery_with_multiple_fields)

Yes

WHERE comparison_condition (=;<>;!=;<;>;>=;<=;ANY;SOME;ALL)

Yes

WHERE compound_condition_with_or_and_not

Yes

WHERE field_name BETWEEN arg1 AND arg2

Yes

WHERE field_name IN (const1,...,constN)

Yes

WHERE field_name IN (subquery)

Yes

WHERE like_condition (operator LIKE)

Yes

WITH RECURSIVE with_query [, ...]

No

Issue 6127: MySQL doesn't support the WITH RECURSIVE clause

WITH with_query [, ...]

Yes

WINDOW DEFINITION

DELETE

Clause Automatically Converted Details

DELETE FROM table_name WHERE CURRENT OF cursor_name

No

Issue 6672: MySQL does not support delete by cursor

DELETE FROM table_name FROM from_list WHERE condition

Yes

DELETE FROM table_name RETURNING {output_expression [ AS output_name ] [, ...]}

No

Issue 6069: MySQL doesn't support the DELETE statement with the RETURNING option

DELETE FROM table_name RETURNING *

No

Issue 6069: MySQL doesn't support the DELETE statement with the RETURNING option

DELETE FROM table_name WHERE condition

Yes

DELETE FROM ONLY table [ [ AS ] alias ]

No

DELETE FROM table [ [ AS ] alias ]

Yes

DELETE FROM table * [ [ AS ] alias ]

No

Issue 6603: Can't use function in from clause

SELECT

Clause Automatically Converted Details

[ existing_window_name ] [ PARTITION BY expression [, ...] ] [ ORDER BY expression [ ASC | DESC | USING operator ] [ NULLS { FIRST | LAST } ] [, ...] ] [ frame_clause ]

No

Issue 6678: MySQL doesn't support function %s with OVER/ORDER BY/WITHIN GROUP/FILTER clause

UPDATE

Clause Automatically Converted Details

UPDATE ONLY table_name SET { column_name = { expression | DEFAULT }} [, ...]

No

UPDATE table_name * SET { column_name = { expression | DEFAULT }} [, ...]

No

UPDATE table_name [ [ AS ] alias ] SET { column_name = { expression | DEFAULT }} [, ...]

Yes

UPDATE table_name SET { column_name = { expression | DEFAULT }} [, ...]

Yes

UPDATE table_name SET { column_name = { expression | DEFAULT }} [, ...] WHERE CURRENT OF cursor_name

No

Issue 6672: MySQL does not support delete by cursor

UPDATE table_name SET { column_name = { expression | DEFAULT }} [, ...] FROM from_list WHERE condition

Partial

Issue 6669: FROM clause was rewritten

UPDATE table_name SET { column_name = { expression | DEFAULT }} [, ...] RETURNING {output_expression [ AS output_name ] [, ...]}

No

Issue 6066: MySQL doesn't support the UPDATE statement with the RETURNING option

UPDATE table_name SET { column_name = { expression | DEFAULT }} [, ...] RETURNING *

No

Issue 6066: MySQL doesn't support the UPDATE statement with the RETURNING option

UPDATE table_name SET { column_name = { expression | DEFAULT }} [, ...] WHERE condition

Yes

UPDATE table_name SET {( column_name [, ...] ) = ( { expression | DEFAULT } [, ...] ) } [, ...]

Yes

UPDATE table_name SET {( column_name [, ...] ) = ( query ) }

Yes

WITH RECURSIVE with_query [, ...] UPDATE table_name SET { column_name = { expression | DEFAULT }} [, ...]

No

Issue 6127: MySQL doesn't support the WITH RECURSIVE clause

WITH with_query [, ...] UPDATE table_name SET { column_name = { expression | DEFAULT }} [, ...]

Yes

PL/pgSQL

Basic Statements

Assignment

Clause Automatically Converted Details

Variable assignment

Partial

Issue 6668: MySQL doesn't support ROW/RECORD type

Executing a Command with No Result

Clause Automatically Converted Details

PERFORM

Yes

Executing a Query with a Single-Row Result

Clause Automatically Converted Details

INTO

No

Issue 6668: MySQL doesn't support ROW/RECORD type

Executing Dynamic Commands

Clause Automatically Converted Details

EXECUTE, INTO, STRICT, USING

No

Issue 6334: MySQL doesn't support the dynamic SQL statement RETURN QUERY EXECUTE

Category

Simple Structure of PL/pgSQL

Clause Automatically Converted Details

DECLARE, BEGIN, END

Yes

Conditionals

IF-THEN

Clause Automatically Converted Details

IF, THEN, END IF

Yes

IF-THEN-ELSE

Clause Automatically Converted Details

IF, THEN, ELSE, END IF

Yes

IF-THEN-ELSIF

Clause Automatically Converted Details

IF, THEN, ELSE, ELSIF, END IF

Yes

Searched CASE

Clause Automatically Converted Details

CASE,WHEN, THEN, ELSE, END CASE

Yes

Simple CASE

Clause Automatically Converted Details

CASE,WHEN, THEN, ELSE, END CASE

Yes

Cursors

CLOSE

Clause Automatically Converted Details

CLOSE

Yes

Declaring Cursor Variables

Clause Automatically Converted Details

NO, SCROLL, CURSOR, FOR

No

Issue 6337: MySQL doesn't support a variable of REFCURSOR type

FETCH

Clause Automatically Converted Details

FETCH [ direction { FROM | IN } ] cursor INTO target;

Partial

Issue 6639: MySQL doesn't support the direction clause

MOVE

Clause Automatically Converted Details

MOVE [ direction { FROM | IN } ] cursor;

No

Issue 6640: MySQL doesn't support the MOVE option

OPEN FOR EXECUTE

Clause Automatically Converted Details

OPEN, NO, SCROLL, FOR, EXECUTE, USING

No

Issue 6337: MySQL doesn't support a variable of REFCURSOR type

OPEN FOR Query

Clause Automatically Converted Details

OPEN, NO, SCROLL, FOR

No

Issue 6638: MySQL doesn't support the SCROLL option in cursors

Opening a Bound Cursor

Clause Automatically Converted Details

OPEN bound_cursorvar [ ( [ argument_name := ] argument_value [, ...] ) ];

Yes

Declarations

ALIAS

Clause Automatically Converted Details

ALIAS FOR

Yes

Collation of PL/pgSQL Variables

Copying Types

Clause Automatically Converted Details

%TYPE, %ROWTYPE

Yes

Declaring Function Parameters

Clause Automatically Converted Details

Declaring function parameters

Yes

Record Types

Clause Automatically Converted Details

Record types

Yes

Issue 6613: Unable to convert a function without OUT parameters returning a RECORD type

Variable Declaration

Clause Automatically Converted Details

Variable declaration

Yes

Errors and Messages

CLOSE

Clause Automatically Converted Details

RAISE ;

No

Issue 6329: MySQL doesn't support the RAISE exception

RAISE [ level ] condition_name [ USING option = expression [, ... ] ];

No

Issue 6329: MySQL doesn't support the RAISE exception

RAISE [ level ] 'format' [, expression [, ... ]] [ USING option = expression [, ... ] ];

Partial

Issue 6332: MySQL doesn't support the RAISE statement to report messages

RAISE [ level ] SQLSTATE 'sqlstate' [ USING option = expression [, ... ] ];

No

Issue 6329: MySQL doesn't support the RAISE exception

RAISE [ level ] USING option = expression [, ... ];

Partial

Issue 6332: MySQL doesn't support the RAISE statement to report messages

Obtaining the Result Status

Clause Automatically Converted Details

GET [ CURRENT ] DIAGNOSTICS variable = item [ , ... ];

No

Issue 6665: MySQL doesn't support the GET [ CURRENT ] DIAGNOSTICS command

Options

Clause Automatically Converted Details

EXCEPTION WHEN condition [ OR condition ... ] THEN handler_statements [..] END;

Partial

Issue 6664: MySQL doesn't support the condition information %s

MESSAGE, DETAIL, HINT, ERRCODE,

No

Issue 6332: MySQL doesn't support the RAISE statement to report messages

Result Status Parameters

Loops

CONTINUE

Clause Automatically Converted Details

CONTINUE, WHEN

Yes

EXIT

Clause Automatically Converted Details

EXIT, WHEN

Yes

FOR (Integer Variant)

Clause Automatically Converted Details

FOR, IN, LOOP, END LOOP, REVERSE, BY

Yes

LOOP

Clause Automatically Converted Details

LOOP, END LOOP

Yes

Looping Through Arrays

Clause Automatically Converted Details

FOREACH, IN, LOOP, END LOOP, SLICE, IN ARRAY

No

Issue 6608: MySQL doesn't support arrays

Looping Through Query Results

Clause Automatically Converted Details

FOR, IN, LOOP, END LOOP, EXECUTE, USING

Yes

WHILE

Clause Automatically Converted Details

WHILE, LOOP, END LOOP

Yes

RETURN Statement

NULL; Command

Clause Automatically Converted Details

RETURN

Yes

RETURN NEXT

No

Issue 6604: MySQL doesn't support RETURN NEXT clause

RETURN QUERY

Yes

RETURN QUERY EXECUTE

No

Issue 6334: MySQL doesn't support the dynamic SQL statement RETURN QUERY EXECUTE

On this page: