Hacker News new | ask | show | jobs
by e12e 1102 days ago
I think you would need a way to trigger the cast either way? Eg concatenate with a string?

Otherwise, maybe a function and a generated column (Ed: in a VIEW i guess, if it chokes on the raw enum)?

https://dba.stackexchange.com/questions/276477/immutably-con...

1 comments

By the time you've done a generated column you might as well go with the articles solution of using text with a check constraint since you're now using the space anyway.