File: debversion.sql

package info (click to toggle)
postgresql-debversion 1.0.8-2~bpo8%2B2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-backports
  • size: 1,616 kB
  • sloc: sh: 11,309; cpp: 157; sql: 131; makefile: 81
file content (54 lines) | stat: -rw-r--r-- 2,146 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- Debian version type and operators                                -*- sql -*-
---
--- Copyright © 2008 Roger Leigh <rleigh@debian.org>
---
--- This program is free software: you can redistribute it and/or modify
--- it under the terms of the GNU General Public License as published by
--- the Free Software Foundation, either version 2 of the License, or
--- (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful, but
--- WITHOUT ANY WARRANTY; without even the implied warranty of
--- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
--- General Public License for more details.
---
--- You should have received a copy of the GNU General Public License
--- along with this program.  If not, see
--- <http://www.gnu.org/licenses/>.

CREATE EXTENSION debversion;

SET client_min_messages = warning; -- suppress "pkey created" message
CREATE TABLE versions (
  ver debversion
    CONSTRAINT versions_pkey PRIMARY KEY
);
RESET client_min_messages;

INSERT INTO versions (ver) VALUES ('4.1.5-2');
INSERT INTO versions (ver) VALUES ('4.0.2-1');
INSERT INTO versions (ver) VALUES ('4.1.4-1');
INSERT INTO versions (ver) VALUES ('4.1.5-1');
INSERT INTO versions (ver) VALUES ('4.2.0-1');
INSERT INTO versions (ver) VALUES ('4.1.4-2');
INSERT INTO versions (ver) VALUES ('4.1.5-2.01');
INSERT INTO versions (ver) VALUES ('4.1.99-a2-1');
INSERT INTO versions (ver) VALUES ('5.2.1-2');
INSERT INTO versions (ver) VALUES ('5.0.0-3');
INSERT INTO versions (ver) VALUES ('5.1.98.2-2');
INSERT INTO versions (ver) VALUES ('3.1.4-1');
INSERT INTO versions (ver) VALUES ('5.2.3-1');
INSERT INTO versions (ver) VALUES ('0:5.2.2-1');
INSERT INTO versions (ver) VALUES ('0:5.2.4-1');
INSERT INTO versions (ver) VALUES ('1:3.2.3-1');

SELECT * FROM versions ORDER BY ver;
SELECT min(ver) FROM versions;
SELECT max(ver) FROM versions;

-- PK violations
INSERT INTO versions (ver) VALUES ('0:4.1.5-2');
INSERT INTO versions (ver) VALUES ('04.1.5-2');
INSERT INTO versions (ver) VALUES ('4.01.5-2');
INSERT INTO versions (ver) VALUES ('4.1.05-2');
INSERT INTO versions (ver) VALUES ('4.1.5-02');