Differences between DB2 and PostgreSQL (1)

Source: Internet
Author: User
Tags db2 client postgresql client

This article mainly describes the similarities and differences between the DB2 database and PostgreSQL in actual development operations, compare and analyze the data definition language and data operation language of DB2 and postgresql for your reference:

1. Data Definition Language (DDL) and peripheral tools: the difference between DB2 and postgresql is almost 0. The specific difference is:

A. If no special tablespace is set for DB2 varchar, the upper limit is 32 KB. postgresql varchar does not have this limit;

B. Binary Large Object Type blob of DB2, which is replaced by bytea type in postgresql;

C. The clob and long varchar types of DB2 text are replaced by the text type in postgresql;

D. Replace serial or bigserial with the generated by default or generated always key words in DB2. (the biggest difference is that)

E. There is no sequence (sequence object) in DB2, and it is more flexible in postgresql;

F. The reset of the auto-increment primary key value in DB2 requires alter table, while the setval () series functions can be used in postgresql to set the sequence, which is simpler;

G. Spatial Data Types (points, lines, and surfaces) are not supported in DB2 and postgresql;

H. Definitions of transaction isolation levels in DB2 are not compatible with SQL standards, and postgresql is fully compatible with SQL standards;

I. The JDBC type4 driver in DB2 does not support GBK database encoding. postgresql does not have this problem;

J. DB2 database encoding conversion is very funny and complex. postgresql is very simple. You only need to set client_encoding to xxx;

K. Currently, DB2 8.1 does not support UNICODE backend encoding. postgresql supports multiple inner codes;

L. triggers of DB2 8.1 cannot read the triggered data table. postgresql does not have this restriction;

M, DB2 8.1 triggers cannot execute stored procedures, postgresql does not have this limit;

N. postgresql has bit (bit) and bitstring (bit String) types. DB2 databases do not;

O, the DB2 client DB2/DB2cmd needs to specify the separator to execute the SQL script, for example, @; the postgresql client defaults to a semicolon;

P. The DB2 client DB2/DB2cmd does not have the command history function. The postgresql client can edit historical commands;


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.