Hacker News new | past | comments | ask | show | jobs | submit login

So glad that GiST indexes now support UUID and ENUM data types. That was a big wart for me due to needing exclusion constraints.



I wrote the initial patch for the UUID support! It's my only Postgres contribution so far (except for docs), and I really only write C a few times a year. I made a few revisions but as I fell behind others picked it up and got it over the finish line. I'm pretty proud to say I participated, and maybe others can be encouraged to get involved too. Most of my day I write Ruby and Javascript. :-)


I always just cast to text in this scenario.


The issue with that is performance and index size. At first that was my solution, but as more data got into the tables that just wasn't working. For UUID's I had to move to casting to bytea using the uuid_send(uuid) function.

For enums, I had to create a function to cast an enum to a unique integer, and used that in my exclusion constraints. It's hacky as hell and not something I like, but it's worked for the past 3 years.

I'll be really really happy to get rid of those hacks come PG 10 though.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: