File: tables.sql

package info (click to toggle)
postgresql-unit 7.10-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 2,540 kB
  • sloc: sql: 1,768; ansic: 1,334; lex: 358; yacc: 140; perl: 100; makefile: 40; sh: 25
file content (75 lines) | stat: -rw-r--r-- 1,423 bytes parent folder | download | duplicates (2)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
SET client_min_messages = warning;

DROP TABLE IF EXISTS prefixes;
CREATE TABLE prefixes (p text);
DELETE FROM prefixes;
INSERT INTO prefixes VALUES
	('q'),('r'),('y'),('z'),('a'),('f'),('p'),('n'),('µ'),('mu'),('m'),('c'),('d'),
	(''),
	('da'),('h'),('k'),('M'),('G'),('T'),('P'),('E'),('Z'),('Y'),('R'),('Q');

DROP TABLE IF EXISTS factors;
CREATE TABLE factors (f double precision);
DELETE FROM factors;
INSERT INTO factors VALUES
	(1e33), (1e30), (1e27), (1e24), (1e21), (1e18), (1e15), (1e12), (1e9), (1e6), (1e3),
	(1),
	(1e-3), (1e-6), (1e-9), (1e-12), (1e-15), (1e-18), (1e-21), (1e-24), (1e-27), (1e-30), (1e-33), (1e-36),
	(0);

DROP TABLE IF EXISTS units;
CREATE TABLE units (u text, unit unit, base boolean, coherent boolean, duplicate boolean);
COMMENT ON COLUMN units.duplicate IS 'For coherent units, this unit has the same dimension as some other base or coherent unit';
DELETE FROM units;
COPY units (u, base, coherent, duplicate) FROM STDIN;
m/m	t	f	f
m	t	f	f
kg	t	f	f
s	t	f	f
A	t	f	f
K	t	f	f
mol	t	f	f
cd	t	f	f
B	t	f	f
sr	f	t	t
Hz	f	t	f
N	f	t	f
Pa	f	t	f
J	f	t	f
W	f	t	f
C	f	t	f
V	f	t	f
F	f	t	f
Ω	f	t	f
ohm	f	t	t
S	f	t	f
Wb	f	t	f
T	f	t	f
H	f	t	f
°C	f	t	t
lm	f	t	t
lx	f	t	f
Bq	f	t	t
Gy	f	t	f
rad	f	f	t
Sv	f	t	t
kat	f	t	f
g	f	f	t
a	f	f	f
l	f	f	f
t	f	f	f
bar	f	f	f
min	f	f	f
hr	f	f	f
d	f	f	f
in	f	f	f
ft	f	f	f
yd	f	f	f
mi	f	f	f
oz	f	f	f
lb	f	f	f
\.
UPDATE units
	SET unit = u::unit;

SELECT * FROM units;