In Oracle I have this Dataype: VARCHAR2(255 Byte) what would be the converted/mapping Dataype in PostgreSQL?
In oracle i have this Dataype: "VARCHAR2(255 Byte)" what would be the converted/mapping Dataype in PostgreSQL?
514 Views Asked by user9342493 At
3
There are 3 best solutions below
0
On
According to Mapping Oracle datatypes to PostgreSQL, you can pick one of
- char,
- varchar,
- text,
- json
I'd try with varchar(255)
0
On
The best match is varchar(255).
But it's not 100% identical because it matches Oracle's varchar(255 char).
There is no way to limit the size of a column based on bytes in Postgres - only characters (which is a different thing for a multi-byte character set).
Note that neither in Postgres nor in Oracle the "magic number" 255 opens up any storage or memory optimizations compared to e.g. 256 or 275.
In Postgresql, Oracle's
VARCHAR2will map toVARCHAR.You can check other data types here: https://www.convert-in.com/docs/ora2pgs/types-mapping.htm