Retool DB: UUID type is no longer nullable

It seems the UUID field type in retool db is no longer nullable. Or has ANY settings at all for that matter.

image

Even worse: as default value it sets a RANDOM UUID, so we can no longer distinguish which ones are set by us. None of these were set by us, but appeared after a migration of a new UUID column:

Screenshot 2025-02-28 at 16.52.55

We have older tables with UUID fields that are nullable:

I cant find any documentation about this or anything in the changelogs that this changed.

Pretty frustrating, since this is currently a showstopper for us.

Is that intended behaviour (and why) or a bug?

Hi @perelin,
This must be super frustrating for you. I am currently checking with our engineering team to see if this is intended behavior.

I want to confirm, however, that you are on retool cloud?

Thanks.

@perelin,
Are you using the UUID field as your primary key?

Hi @lindakwoo

We are using retool onprem 3.114.8

no, this UUID column is not a primary key

I created a video of the behavior:

  • observe that creating a new UUID column in a database fills all rows of that column with UUIDs as default - no way to configure this

Video:
https://jirafeau.claudron.aux.paulina24.de/f.php?h=1kZcq5tm&d=1

@perelin,
Can you clarify what you mean when you said "None of these were set by us, but appeared after a migration of a new UUID column"? Exactly what steps did you take?

Thanks!

Hi @lindakwoo ,

have a look at the video I send.

When I add a UUID column to an existing table, all column fields are populated with random UUIDs by default. No way to configure this. I want to be able to set the default value to null, so we can populate the column fields when we need them.

@perelin,

Instead of choosing "UUID" type, choose "custom" under the Field type, and then in the PostgreSQL type, select UUID. This option will allow you to set default values to null

Then when you click on the field, you have the option to set a value or set to null:

CleanShot 2025-03-26 at 08.27.19@2x

I hope this helps!

Thanks! Goes without saying: this is confusing and undocumented behaviour. Id suggest removing the UUID type then from the shortcut dropdown list.

Adding a note here (for search purposes) that if you are using the UUID type in a table and are attempting to add a record you may see an error similar to this:

statusCode: 422 
error: "Unprocessable Entity"
message: "Insert into <table_name> failed: you must satisfy the constraint '<table_name> <column_name> key'" 

Using the above work around resolves this issue :raised_hands:

2 Likes