File: tables.out

package info (click to toggle)
postgresql-unit 7.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, 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 (74 lines) | stat: -rw-r--r-- 3,158 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
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;
UPDATE units
	SET unit = u::unit;
SELECT * FROM units;
  u  |      unit      | base | coherent | duplicate 
-----+----------------+------+----------+-----------
 m/m | 1              | t    | f        | f
 m   | 1 m            | t    | f        | f
 kg  | 1 kg           | t    | f        | f
 s   | 1 s            | t    | f        | f
 A   | 1 A            | t    | f        | f
 K   | 1 K            | t    | f        | f
 mol | 1 mol          | t    | f        | f
 cd  | 1 cd           | t    | f        | f
 B   | 1 B            | t    | f        | f
 sr  | 1              | f    | t        | t
 Hz  | 1 Hz           | f    | t        | f
 N   | 1 N            | f    | t        | f
 Pa  | 1 Pa           | f    | t        | f
 J   | 1 J            | f    | t        | f
 W   | 1 W            | f    | t        | f
 C   | 1 C            | f    | t        | f
 V   | 1 V            | f    | t        | f
 F   | 1 F            | f    | t        | f
 Ω   | 1 Ω            | f    | t        | f
 ohm | 1 Ω            | f    | t        | t
 S   | 1 S            | f    | t        | f
 Wb  | 1 Wb           | f    | t        | f
 T   | 1 T            | f    | t        | f
 H   | 1 H            | f    | t        | f
 °C  | 1 K            | f    | t        | t
 lm  | 1 cd           | f    | t        | t
 lx  | 1 lx           | f    | t        | f
 Bq  | 1 Hz           | f    | t        | t
 Gy  | 1 Gy           | f    | t        | f
 rad | 10 mGy         | f    | f        | t
 Sv  | 1 Gy           | f    | t        | t
 kat | 1 kat          | f    | t        | f
 g   | 1 g            | f    | f        | t
 a   | 100 m^2        | f    | f        | f
 l   | 0.001 m^3      | f    | f        | f
 t   | 1 Mg           | f    | f        | f
 bar | 100 kPa        | f    | f        | f
 min | 00:01:00 s     | f    | f        | f
 hr  | 01:00:00 s     | f    | f        | f
 d   | 1 d            | f    | f        | f
 in  | 25.4 mm        | f    | f        | f
 ft  | 304.8 mm       | f    | f        | f
 yd  | 914.4 mm       | f    | f        | f
 mi  | 1.609344 km    | f    | f        | f
 oz  | 28.349523125 g | f    | f        | f
 lb  | 453.59237 g    | f    | f        | f
(46 rows)