

In PostgreSQL, the Serial data type allows us to generate unique integer numbers (IDs, identity, auto-increment, sequence) for a column in a table. PostgreSQL change column type from integer to serial if you want to change column type to json, just replace jsonb with josn.And at the last line of query where type jsonb, using clause is used to specify the column type, using column_name::datatype.In the above output, description data type changed to jsonb. PostgreSQL change the column data type from text to jsonb Suppose you are an employee of XYZ company in the USA and in front of you have a situation to change the data type of a column of some database, so here in this section, we will learn ‘How to change the column type from data type to another.įirst, Let’s create a table and insert some data into the table then follow this tutorial to change the data type of column.

POSTGRES ALTER COLUMN DATA TYPE HOW TO
In this Postgresql tutorial, we will learn about how to change column type in PostgreSQL from one data type to another.
