Can't change column uuid back from type text to type uuid

i kept getting the error (on the server) invalid input syntax for type uuid: "undefined" when updating a row in a table. so i tried to change the type of my uuid column from uuid to text, hoping it'd solve it. i realized i lose the gen_random_uuid() function that way, so i wanted to change it back... only that i can't change it back now. not with the UI (table editor) and i can't figure out the right sql query with the help of the ai either (sql editor). table editor problem: i select uuid from the types, and gen_random_uuid() from default value, i click save, the spinning wheel appears for ~300ms, then it disappears, and the column editing sidebar doesn't disappear, so i'm stuck with it not changing. sql editor problem:
alter table draft
alter column uuid
type uuid using uuid::uuid
alter table draft
alter column uuid
type uuid using uuid::uuid
for this query i get:
ERROR: 42804: default for column "uuid" cannot be cast automatically to type uuid
ERROR: 42804: default for column "uuid" cannot be cast automatically to type uuid
and i can't go forward. i don't really know where invalid input syntax for type uuid: "undefined" is coming from.
No description
1 Reply
beroer
beroerOP2y ago
i added non-uuid type rows (text) that's why changing it wasn't working.

Did you find this page helpful?