- range of bigin • numrange - numeric range • tsrange - range of timestamp • tstzrange - range of timestamp with time zone • daterange - range of dates 10 Sunday, June 9, 13
INSERT INTO rooms VALUES (1, '["2013-06-08","2013-06-10")'); # SELECT * FROM rooms WHERE during && '["2013-06-09","2013-07-15")'; room | during ------+------------------------- 1 | [2013-06-08,2013-06-10) (1 row) # SELECT * FROM rooms WHERE during && '["2013-06-10","2013-07-15")'; room | during ------+-------- (0 rows) 13 Sunday, June 9, 13
models from django_hstore import hstore class Item(models.Model): name = models.CharField(max_length=250) data = hstore.DictionaryField(db_index=True) objects = hstore.Manager() 18 Sunday, June 9, 13
text, post_text tsvector); CREATE INDEX posttext_gin ON articles USING GIN(post_text); CREATE TRIGGER update_posttext BEFORE INSERT OR UPDATE ON articles FOR EACH ROW EXECUTE PROCEDURE tsvector_update_trigger('PostText', 'english', title, content); 20 Sunday, June 9, 13