

Consider the following example: VARCHAR2(20 BYTE) vs.VARCHAR2(10 CHAR). A small detail is that in Oracle varchar2 can be the number of bytes or the number of characters. In general “CPU data types” such as integer and bigint are much faster than “numeric”.Ī second important thing is “varchar2”: On the PostgreSQL side it can easily be mapped to varchar or text. The way to map this is to use “integer” or “bigint” on the PostgreSQL side.

For example: In Oracle you might see “number (5, 0)”. However, there is more: In Oracle there is no such thing as “integer”. However, this is of course not desirable. Numeric, float4, float8, int2, int4, int8,ĭate, timestamp, timestamptz, char, varchar, textĪs you can see all types can always be represented as text and as varchar. Numeric, float4, float8, char, varchar, text The following table contains a lot of potential options: Let us take a look and see, which types can be matched. Still: At the end of the day there are just more data types, which are can be used by applications, which of course Of course not all of them are useful and many of them are purely internal used for internal purposes. As of version 10.0 an empty PostgreSQL database will expose the staggering number of 92 data types. The first thing many people might notice is: PostgreSQL has many more data types than Oracle. While there are many similarities between Oracle and PostgreSQL there are a couple of differences, which are quite noteworthy. This blog will try to shed some light and show, how things work. One of the first things most people will notice, however, is that those datatypes available in Oracle might not be quite the same in PostgreSQL.
#POSTGRESQL VARCHAR PROFESSIONAL#
For those of you out there working with PostgreSQL in a professional way, migrating from Oracle to PostgreSQL might be one of the most beloved tasks available.
