Storing URIs in PostgreSQL
About two months ago, this happened:
What form of bribery would be required to convince someone to write an `email` and `url` data type for Postgres, by the way? Any takers?
— Peter van Hardenberg (@pvh) February 16, 2015
And a few hours later:
— Peter Eisentraut (@petereisentraut) February 18, 2015
It took a few more hours and days after this to refine some details, but I have now tagged the first release of this extension. Give it a try and let me know what you think. Bug reports and feature requests are welcome.
(I chose to name the data type uri
instead of url
, as originally
suggested, because that is more correct and matches what the parsing
library calls it. One could create a domain if one prefers the other
name or if one wants to restrict the values to certain kinds of URIs
or URLs.)
(If you are interested in storing email addresses, here is an idea.)