I am working with python.
I have a field with "text" datatype in postgres. Whenever I try to save a very large string, it throws internal error in python, but if I save the string with a smaller size, it saves it properly.
I don't understand the problem. Is it that there is some maximum limit for entering the characters for "TEXT" datatype?
PostgreSQL supports a character data type called TEXT. This data type is used to store character of unlimited length. It is represented as text in PostgreSQL. The performance of the varchar (without n) and text are the same. Syntax: variable_name TEXT.
Different from other database systems, in PostgreSQL, there is no performance difference among three character types. In most cases, you should use TEXT or VARCHAR . And you use the VARCHAR(n) when you want PostgreSQL to check for the length.
The maximum limit of size character using character varying data type in PostgreSQL is 10485760. The below example shows that the size of the character using character varying data type in PostgreSQL is 10485760.
From the manual:
In any case, the longest possible character string that can be stored is about 1 GB.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With