summaryrefslogtreecommitdiffstats
path: root/contrib/btree_gin/sql/bytea.sql
blob: 5f3eb11b169872b890da80c7cb971bbf46b517c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
set enable_seqscan=off;
-- ensure consistent test output regardless of the default bytea format
SET bytea_output TO escape;

CREATE TABLE test_bytea (
	i bytea
);

INSERT INTO test_bytea VALUES ('a'),('ab'),('abc'),('abb'),('axy'),('xyz');

CREATE INDEX idx_bytea ON test_bytea USING gin (i);

SELECT * FROM test_bytea WHERE i<'abc'::bytea ORDER BY i;
SELECT * FROM test_bytea WHERE i<='abc'::bytea ORDER BY i;
SELECT * FROM test_bytea WHERE i='abc'::bytea ORDER BY i;
SELECT * FROM test_bytea WHERE i>='abc'::bytea ORDER BY i;
SELECT * FROM test_bytea WHERE i>'abc'::bytea ORDER BY i;