0

In Oracle I have this Dataype: VARCHAR2(255 Byte) what would be the converted/mapping Dataype in PostgreSQL?

3 Answers3

0

In Postgresql, Oracle's VARCHAR2 will map to VARCHAR.

You can check other data types here: https://www.convert-in.com/docs/ora2pgs/types-mapping.htm

Rui Costa
  • 417
  • 2
  • 11
0

According to Mapping Oracle datatypes to PostgreSQL, you can pick one of

  • char,
  • varchar,
  • text,
  • json

I'd try with varchar(255)

Littlefoot
  • 131,892
  • 15
  • 35
  • 57
0

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.