This is an old revision of the document!
SQLines provides tools and services to help you transfer data, convert database schema (DDL), views, stored procedures, functions, triggers, queries and SQL scripts from Sybase SQL Anywhere, Sybase Adaptive Server Anywhere (ASA) to PostgreSQL.
Sybase SQL Anywhere 12, 11, 10 and 9
PostgreSQL 9.x and 8.x
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 | BIT | 0 or 1 value; NULL is not allowed | BOOLEAN |
5 | BIT VARYING(n) | Variable-length bit array, 1 ⇐ n ⇐ 32767 | BIT VARYING(n) |
6 | CHAR(n), CHARACTER(n) | Fixed-length string, 1 ⇐ n ⇐ 32767 | CHAR(n), CHARACTER(n) |
7 | DATE | Date (year, month and day) | DATE |
8 | DATETIME | Date and time with fraction | TIMESTAMP |
9 | DATETIMEOFFSET | Date and time with fraction and time zone | TIMESTAMP WITH TIME ZONE |
10 | DECIMAL(p,s), DEC(p,s) | Fixed point number | DECIMAL(p,s), DEC(p,s) |
11 | DOUBLE [PRECISION] | Double-precision floating-point number | DOUBLE PRECISION |
12 | FLOAT(p) | Floating-point number | DOUBLE PRECISION |
13 | IMAGE | Binary data, ⇐ 2G | BYTEA |
14 | INTEGER, INT | 32-bit integer | INTEGER, INT |
15 | LONG BINARY | Binary data, ⇐ 2G | BYTEA |
16 | LONG BIT VARYING | Bit array data, ⇐ 2G | BYTEA |
17 | LONG NVARCHAR | UTF-8 character data, ⇐ 2G | TEXT |
18 | LONG VARBIT | Bit array data, ⇐ 2G | BYTEA |
19 | LONG VARCHAR | Character data, ⇐ 2G | TEXT |
20 | MONEY | Monetary data | MONEY |
21 | NCHAR(n) | Fixed-length UTF-8 string, 1 ⇐ n ⇐ 32767 | CHAR(n) |
22 | NTEXT | UTF-8 character data, ⇐ 2G | TEXT |
23 | NUMERIC(p,s) | Fixed point number | NUMERIC(p,s) |
24 | NVARCHAR(n) | Variable-length UTF-8 string, 1 ⇐ n ⇐ 32767 | VARCHAR(n) |
25 | REAL | Single-precision floating-point number | REAL |
26 | SMALLDATETIME | Date and time with fraction | TIMESTAMP |
27 | SMALLINT | 16-bit integer | SMALLINT |
28 | SMALLMONEY | Monetary data, ⇐ million currency units | MONEY |
29 | TEXT | Character data, ⇐ 2G | TEXT |
30 | TIME | Time (hour, minute, second and fraction) | TIME |
31 | TIMESTAMP | Date and time with fraction | TIMESTAMP |
32 | TIMESTAMP WITH TIME ZONE | Date and time with fraction and time zone | TIMESTAMP WITH TIME ZONE |
33 | TINYINT | 8-bit unsigned integer, 0 to 255 | SMALLINT |
34 | UNIQUEIDENTIFIER | 16-byte GUID (UUID) data | CHAR(16) |
35 | UNIQUEIDENTIFIERSTR | GUID (UUID) data in string format | UUID |
36 | UNSIGNED BIGINT | 64-bit unsigned integer | NUMERIC(20) |
37 | UNSIGNED INT | 32-bit unsigned integer | NUMERIC(10) |
38 | UNSIGNED SMALLINT | 16-bit unsigned integer | NUMERIC(5) |
39 | UNSIGNED TINYINT | 8-bit unsigned integer | NUMERIC(3) |
40 | VARBINARY(n) | Variable-length binary string, 1 ⇐ n ⇐ 32767 | BYTEA |
41 | VARBIT(n) | Variable-length bit array, 1 ⇐ n ⇐ 32767 | VARBIT(n) |
42 | VARCHAR(n) | Variable-length string, 1 ⇐ n ⇐ 32767 | VARCHAR(n) |
43 | XML | XML data | XML |