Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PostgreSQL values of column (type text) are shown as numbers

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:

screenshot

like image 947
Tengo Chilingarashvili Avatar asked Nov 19 '18 15:11

Tengo Chilingarashvili


People also ask

What is text data type in PostgreSQL?

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.

How do I change the column type in PostgreSQL?

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.

What is the difference between varchar and text in PostgreSQL?

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.


1 Answers

If you use hibernate annotations in java, you need to specify type of Lob. Example:

    @Lob
    @Type(type = "org.hibernate.type.TextType")
    String largeText;
like image 118
Alex Avatar answered Oct 30 '22 05:10

Alex