Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add data type for urls #6

Open
fnando opened this issue Nov 24, 2015 · 3 comments
Open

Add data type for urls #6

fnando opened this issue Nov 24, 2015 · 3 comments

Comments

@fnando
Copy link

fnando commented Nov 24, 2015

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.

@petere
Copy link
Owner

petere commented Dec 1, 2015

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.

@fnando
Copy link
Author

fnando commented Dec 1, 2015

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.

@petere
Copy link
Owner

petere commented Dec 2, 2015

Well, if you use a domain, you only have to do it once. (And you don't need the IS NOT NULL check.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants