Add data type for urls
fnando opened this issue · comments
It would be nice to have a data type url
, which validates the scheme against http
/https
. It would be nicer if this extension had support for hostname validation against TLDs.
You can create a domain that checks that scheme part of the value. What else would you want to do beyond that?
For TLD verification, see petere/pgemailaddr#1.
Yeah, I'm using a CHECK
for that. The problem is that you have to do something like CHECK (uri_scheme(site::uri) IS NOT NULL AND uri_scheme(site::uri) ~ '^https?$')
, which is kinda cumbersome.
Well, if you use a domain, you only have to do it once. (And you don't need the IS NOT NULL
check.)