I have a table Campaign_actions which has a column terms
with type text.
Today I noticed that all text in the column terms
are changed to numbers:
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.
First, specify the name of the table to which the column you want to change belongs in the ALTER TABLE clause. Second, give the name of column whose data type will be changed in the ALTER COLUMN clause. Third, provide the new data type for the column after the TYPE keyword.
Difference Between PostgreSQL TEXT and VARCHAR Data Types The only difference between TEXT and VARCHAR(n) is that you can limit the maximum length of a VARCHAR column, for example, VARCHAR(255) does not allow inserting a string more than 255 characters long.
If you use hibernate annotations in java, you need to specify type of Lob. Example:
@Lob
@Type(type = "org.hibernate.type.TextType")
String largeText;
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