Home > database >  PostgreSQL how to put the table in a field type changed to jsonb
PostgreSQL how to put the table in a field type changed to jsonb

Time:09-25

As title, originally creates the table field type write wrong "IP" varchar (255), COLLATE "default",
Now want to change for jsonb type, can have what way? Because have already save data (jsonb also supports data), fixed data how to modify

CodePudding user response:

The alter table "t_userid_login_2018-09-05 _copy" alter IP type jsonb;
Also want to report errors,
ERROR: the column "IP" always be cast automatically to type jsonb
HINT: You took the need to specify "USING IP: : jsonb".
Let me USING IP: : jsonb, I will be forced to, don't know where to use USING IP: : jsonb

CodePudding user response:

The alter table "t_userid_login_2018-09-05 _copy" alter IP type jsonb USING (IP: : jsonb);
  • Related