Sybase SQL Anywhere to PostgreSQL Migration

SQLines tools can help you transfer data, convert database schema (DDL), views, stored procedures, functions, triggers, queries and SQL scripts from SAP Sybase SQL Anywhere, Sybase Adaptive Server Anywhere (ASA) to PostgreSQL (Postgres).

Databases:

  • SAP Sybase SQL Anywhere 17, 16, 12, 11, 10, 9 and 5
  • PostgreSQL 16.x, 15.x, 14.x, 13.x, 12.x, 11.x, 10.x and 9.x

Migration Reference

Data Types

Converting data types:

Sybase SQL Anywhere PostgreSQL
1 BIGINT 64-bit integer BIGINT
2 BINARY(n) Variable-length binary string, 1 ⇐ n ⇐ 32767 BYTEA
3 BINARY VARYING(n) Variable-length binary string, 1 ⇐ n ⇐ 32767 BYTEA
4 CHAR(n), CHARACTER(n) Fixed-length string, 1 ⇐ n ⇐ 32767 CHAR(n), CHARACTER(n)
5 DATE Date (year, month and day) DATE
6 DATETIME Date and time with fraction TIMESTAMP
7 DATETIMEOFFSET Date and time with fraction and time zone TIMESTAMP WITH TIME ZONE
8 DECIMAL(p,s), DEC(p,s) Fixed point number DECIMAL(p,s), DEC(p,s)
9 DOUBLE [PRECISION] Double-precision floating-point number DOUBLE PRECISION
10 FLOAT(p) Floating-point number DOUBLE PRECISION
11 IMAGE Binary data, ⇐ 2G BYTEA
12 INTEGER, INT 32-bit integer INTEGER, INT
13 LONG BINARY Binary data, ⇐ 2G BYTEA
14 LONG BIT VARYING Bit array data, ⇐ 2G BYTEA
15 LONG NVARCHAR UTF-8 character data, ⇐ 2G TEXT
16 LONG VARBIT Bit array data, ⇐ 2G BYTEA
17 LONG VARCHAR Character data, ⇐ 2G TEXT
18 MONEY Monetary data MONEY
19 NCHAR(n) Fixed-length UTF-8 string, 1 ⇐ n ⇐ 32767 CHAR(n)
20 NTEXT UTF-8 character data, ⇐ 2G TEXT
21 NUMERIC(p,s) Fixed point number NUMERIC(p,s)
22 NVARCHAR(n) Variable-length UTF-8 string, 1 ⇐ n ⇐ 32767 VARCHAR(n)
23 REAL Single-precision floating-point number REAL
24 SMALLDATETIME Date and time with fraction TIMESTAMP
25 SMALLINT 16-bit integer SMALLINT
26 SMALLMONEY Monetary data, ⇐ million currency units MONEY
27 TEXT Character data, ⇐ 2G TEXT
28 TIME Time (hour, minute, second and fraction) TIME
29 TIMESTAMP Date and time with fraction TIMESTAMP
30 TIMESTAMP WITH TIME ZONE Date and time with fraction and time zone TIMESTAMP WITH TIME ZONE
31 TINYINT 8-bit unsigned integer, 0 to 255 SMALLINT
32 UNSIGNED BIGINT 64-bit unsigned integer NUMERIC(20)
33 UNSIGNED INT 32-bit unsigned integer NUMERIC(10)
34 UNSIGNED SMALLINT 16-bit unsigned integer NUMERIC(5)
35 UNSIGNED TINYINT 8-bit unsigned integer NUMERIC(3)
36 VARBINARY(n) Variable-length binary string, 1 ⇐ n ⇐ 32767 BYTEA
37 VARCHAR(n) Variable-length string, 1 ⇐ n ⇐ 32767 VARCHAR(n)

Other data types:

Sybase SQL Anywhere PostgreSQL
1 BIT 0, 1 or NULL BOOLEAN, BOOL
2 BIT VARYING(n) Variable-length bit array, 1 ⇐ n ⇐ 32767 BIT VARYING(n)
3 UNIQUEIDENTIFIER 16-byte GUID (UUID) data CHAR(16)
4 UNIQUEIDENTIFIERSTR GUID (UUID) data in string format UUID
5 VARBIT(n) Variable-length bit array, 1 ⇐ n ⇐ 32767 VARBIT(n)
6 XML XML data XML