123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- # Copyright Materialize, Inc. and contributors. All rights reserved.
- #
- # Use of this software is governed by the Business Source License
- # included in the LICENSE file at the root of this repository.
- #
- # As of the Change Date specified in that file, in accordance with
- # the Business Source License, use of this software will be governed
- # by the Apache License, Version 2.0.
- #
- # CREATE views containing ranges
- > CREATE MATERIALIZED VIEW int4range_view (a) AS
- SELECT column1::int4range FROM
- (
- VALUES
- ('[,1)'),
- ('[,1]'),
- ('[,)'),
- ('[,]'),
- ('(,1)'),
- ('(,1]'),
- ('(,)'),
- ('(,]'),
- ('[-1,1)'),
- ('[-1,1]'),
- ('(-1,1)'),
- ('(-1,1]'),
- ('[0,0)'),
- ('[0,0]'),
- ('(0,0)'),
- ('(0,0]'),
- ('[1,)'),
- ('[1,]'),
- ('(1,)'),
- ('(1,]')
- );
- > SELECT a::text AS t FROM int4range_view ORDER BY a;
- empty
- empty
- empty
- (,1)
- (,1)
- (,2)
- (,2)
- (,)
- (,)
- (,)
- (,)
- [-1,1)
- [-1,2)
- [0,1)
- [0,1)
- [0,2)
- [1,)
- [1,)
- [2,)
- [2,)
- > CREATE MATERIALIZED VIEW int8range_view (a) AS
- SELECT column1::int8range FROM
- (
- VALUES
- ('[,1)'),
- ('[,1]'),
- ('[,)'),
- ('[,]'),
- ('(,1)'),
- ('(,1]'),
- ('(,)'),
- ('(,]'),
- ('[-1,1)'),
- ('[-1,1]'),
- ('(-1,1)'),
- ('(-1,1]'),
- ('[0,0)'),
- ('[0,0]'),
- ('(0,0)'),
- ('(0,0]'),
- ('[1,)'),
- ('[1,]'),
- ('(1,)'),
- ('(1,]')
- );
- > SELECT a::text AS t FROM int4range_view ORDER BY a;
- empty
- empty
- empty
- (,1)
- (,1)
- (,2)
- (,2)
- (,)
- (,)
- (,)
- (,)
- [-1,1)
- [-1,2)
- [0,1)
- [0,1)
- [0,2)
- [1,)
- [1,)
- [2,)
- [2,)
- > CREATE MATERIALIZED VIEW daterange_view (a) AS
- SELECT column1::daterange FROM
- (
- VALUES
- ('[,)'),
- ('[,1970-01-01]'),
- ('[,)'),
- ('[,]'),
- ('(,1970-01-01)'),
- ('(,1970-01-01]'),
- ('(,)'),
- ('(,]'),
- ('[1969-12-31,1970-01-01)'),
- ('[1969-12-31,1970-01-01]'),
- ('(1969-12-31,1970-01-01)'),
- ('(1969-12-31,1970-01-01]'),
- ('[1970-01-01,)'),
- ('[1970-01-01,]'),
- ('(1970-01-01,)'),
- ('(1970-01-01,]')
- );
- > SELECT a::text AS t FROM daterange_view ORDER BY a;
- empty
- (,1970-01-01)
- (,1970-01-02)
- (,1970-01-02)
- (,)
- (,)
- (,)
- (,)
- (,)
- [1969-12-31,1970-01-01)
- [1969-12-31,1970-01-02)
- [1970-01-01,1970-01-02)
- [1970-01-01,)
- [1970-01-01,)
- [1970-01-02,)
- [1970-01-02,)
|