File: dump-units.sh

package info (click to toggle)
postgresql-unit 7.10-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,540 kB
  • sloc: sql: 1,768; ansic: 1,334; lex: 358; yacc: 140; perl: 100; makefile: 40; sh: 25
file content (9 lines) | stat: -rwxr-xr-x 404 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
#!/bin/sh

# output intentionally not ordered so the initial load order from definitions.units is preserved
psql <<-EOT
	SET extra_float_digits = 3;
	SET unit.output_base_units = on;
	\copy (SELECT prefix, factor, definition, dump FROM unit_prefixes ORDER BY ordering) to 'unit_prefixes.data'
	\copy (SELECT name, unit, shift, definition, dump FROM unit_units ORDER BY ordering) to 'unit_units.data'
EOT