Sign up ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have to create a custom domain that is an interval between two years, but i actually need both years. For example:

'2013/2014'
'2015/2016'

Is there a way to pack both years inside a single domain, or have i to separate them in two attributes of the relation?

share|improve this question
1  
You can use intervals for this. I mean the range datatypes –  ypercube Sep 27 '14 at 8:29
1  
I agree with ypercube: range types are the way to go here. –  a_horse_with_no_name Sep 27 '14 at 8:58
    
If you want to index a column with a range type, and you're using a range operator (e.g. the @> operator to see if the range includes a value), you'll need to use a GiST index. Btree is only useful on equality for a range. –  hbn Sep 27 '14 at 18:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.