Search code examples
databasepostgresqltypesclob

PostgreSQL Clob datatype


PostgreSQL supports both clob and text data types for storing large texts. I've used clob data type as we are migrating the DB from Oracle. I understand that the clob data type in PostgreSQL can only store up to 1GB of text rather than the 4GB in oracle.

Since my text size is well below 1GB, I am fine with using either of these types. So can I use PostgreSQL clob datatype or is there any advantage for text datatype over clob?

Any help will be much appreciated and Thanks in Advance.


Solution

  • The clob data type is unsupported in Postgres. However, it can be easily defined as a synonym to the text type:

    create domain clob as text;