IBM DB2 To PostgreSQL Migration - SQLines Tools
IBM DB2 To PostgreSQL Migration - SQLines Tools
Command Line
SQLines Data
Overview
Command Line
Configuration File
Connection Strings
Migration to MariaDB
IBM DB2 to MariaDB
MySQL to MariaDB
Oracle to MariaDB
Informix to MariaDB
PostgreSQL to MariaDB
Migration to Oracle
IBM DB2 to Oracle
Informix to Oracle
Teradata to Oracle
PostgreSQL to Oracle
MySQL to Oracle
Migration to MySQL
IBM DB2 to MySQL
Informix to MySQL
Oracle to MySQL
PostgreSQL to MySQL
Migration to PostgreSQL
IBM DB2 to PostgreSQL
Informix to PostgreSQL
Oracle to PostgreSQL
MySQL to PostgreSQL
Migration to Redshift
Hadoop to Redshift
Oracle to Redshift
Teradata to Redshift
Migration to Snowflake
IBM DB2 to Snowflake
Hadoop to Snowflake
Oracle to Snowflake
Teradata to Snowflake
Oracle to Hive
Redshift to Hive
Teradata to Hive
Migration to Spark
Oracle to Spark
Redshift to Spark
Teradata to Spark
Migration to Presto/Trino
Hive to Trino
Oracle to Trino
Redshift to Trino
Teradata to Trino
Migration to Netezza
Oracle to Netezza
Migration to Greenplum
IBM DB2 to Greenplum
Oracle to Greenplum
Migration to EsgynDB
Oracle to EsgynDB
Teradata to EsgynDB
Application Conversion
Java
C# .NET
PowerBuilder
COBOL
Database Reference
Oracle
SQL Server
IBM DB2
MariaDB
MySQL
PostgreSQL
Sybase
Sybase ASA
Informix
Teradata
Databases:
IBM DB2 for LUW, z/OS and OS/400 11.x, 10.x, 9.x, 8.x and 7.x
PostgreSQL 14.x, 13.x, 12.x, 11.x, 10.x and 9.x
Migration Reference
Data Types
CREATE PROCEDURE
Procedural SQL Statements
Data Types
Data type mapping between DB2 and PostgreSQL:
DB2 PostgreSQL
1 BIGINT 64-bit integer BIGINT
2 BLOB(n) Binary large object, 1 ⇐ n ⇐ 2G BYTEA
3 CHAR(n), CHARACTER(n) Fixed-length string, 1 ⇐ n ⇐ 254 CHAR(n), CHARACTER(n)
4 CHAR(n) FOR BIT DATA Fixed-length byte string, 1 ⇐ n ⇐ 254 BYTEA
5 CHARACTER VARYING(n) Variable-length string, 1 ⇐ n ⇐ 32672 VARCHAR(n)
DB2 PostgreSQL
procedure_body
BEGIN
END procedure_body
END;
$$ LANGUAGE plpgsql;
For more information, see Conversion of Procedural SQL Statements.
Variable declarations:
DB2 PostgreSQL
1 Declarations are inside BEGIN END block Declarations are before BEGIN END block
2 DECLARE var datatype DEFAULT value var datatype DEFAULT value
3 DECLARE var, var2, … datatype var datatype; var2 datatype; …
4 DECLARE cur CURSOR FOR query Cursor declaration cur CURSOR FOR query
Variable Assignments:
DB2 PostgreSQL
1 SET v1 = value v1 := value
2 SET v1 = value, v2 = value2, … v1 := value; v2 := value2; …
3 SET (v1, v2, …) = (value, value2, …) v1 := value; v2 := value2; …
4 SET (v1, v2, …) = (SELECT c1, c2, …) SELECT c1, c2, … INTO v1, v2, …
Cursor operations:
DB2 PostgreSQL
1 DECLARE cur CURSOR FOR query Cursor declaration cur CURSOR FOR query
2 DECLARE cur CURSOR WITH RETURN ... Return result set cur REFCURSOR
DECLARE cur WITH RETURN FOR stmt