I have table of users with UUIDv4 as primary key. How can I select all rows with id starting with 'e2eb5'?
I tried following select:
SELECT * FROM "user" WHERE "id" LIKE 'e2eb5%';
In my application there are less than one thousand users and first part of UUID should be just all info you need to identify them.
Therefore I want user detail to be on url like this:
/users/e2eb5
Instead of:
/users/3b0fbfd6-0661-4880-b5c5-4659ed85fa96
Edit:
Querying it as suggested here: How to query UUID for postgres
where some_uuid between 'e99aec55-0000-0000-0000-000000000000'
and 'e99aec55-ffff-ffff-ffff-ffffffffffff'
is not viable solution as it requires either fixed length of uuid prefix or writing more complex query.