PG vs. Oracle Comparison

Source: Internet
Author: User

The so-called dynamic engine, that is, for example, there are many table joins, the original practice is to build this execution plan from the beginning, and then execute, but in fact, many table joins, the first time you build the execution plan is probably wrong.

Then the dynamic execution plan means that it can perform edges to help collect the most accurate execution information to adjust the subsequent execution plan

Oracle Syntax →postgresql syntax

1, Varchar2→varchar

2, Date→timestamp

3, Sysdate→localtimestamp

4, Oracle "and Null are the same, but Pgsql is different, so you need to change ' to null

5. String Connector | |

Oracle: ' A ' | | Null result is ' a '

Pgsql: ' A ' | | NULL result is NULL

So replace it with the concat () function.

6, Trunc (time) →date_trunc ()

7, To_char, To_number, to_date pgsql All need to specify the format

8, Decode→case

9, Nvl→coalesce ()

10, outer connection (+) →left (right) join

11. Goto Statement →pgsql not supported

12, Pgsql does not support procedure and package, all need to rewrite into function

When the package has global variables it is troublesome to modify it, we are passing it with a temporary table.

13. Cursor Properties

%found→found

%notfound→not found

%isopen→pgsql not supported

%rowcount→pgsql not supported

In addition to the other differences about the cursor, refer to this post

http://bbs.pgsqldb.com/client/post_show.php?zt_auto_bh=56751

14, Commit,rollback; Savepoint→pgsql not supported

15. Oracle's system packages, such as Dbms_output,dbms_sql,util_file,util_mail→pgsql, do not support

16. Different exception handling methods

17, trigger syntax is different

18, the date of the addition and subtraction of the calculation syntax is different.

1. Oracle has no inheritance and overloading features, Pgsql supports inheritance and function overloading;

2, 2, the empty string in Oracle is equivalent to null,pgsql in separate processing;

3, 3, Oracle does not support the Boolean type, you can use the integer type instead

4, 4, Pgsql:: For type conversion, Oracle does not have;

5, 5, Oracle can use rownum paging, pgsql use limit;

6, 6, Pgsql, the query statement from the clause, the table name can be added as aliases, Oracle, the table name is not allowed to appear as;

7, 7, Pgsql sub-query strict requirements, must have an alias to be able;

8, 8, the sequence is inconsistent with the way.

PG vs. Oracle Comparison

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.