Commit | Line | Data |
---|---|---|
9c8cd3ac | 1 | #!/bin/bash |
ec4760e5 JD |
2 | SHORTCODES=$1 |
3 | if [ -z "${SHORTCODES}" ]; then | |
4 | SHORTCODES="shortcodes.csv" | |
5 | fi | |
278f5edb | 6 | psql -Upostgres -U evergreen evergreen -h prod-pg96-db2-sitka -o $SHORTCODES \ |
9c8cd3ac RJ |
7 | -c "COPY ( |
8 | SELECT | |
9 | a.shortname,a.name,b.shortname AS parent | |
10 | FROM actor.org_unit a | |
11 | JOIN actor.org_unit b | |
12 | ON (a.parent_ou = b.id) | |
13 | ORDER BY shortname | |
14 | ) TO STDOUT WITH CSV HEADER QUOTE AS '\"' FORCE QUOTE shortname, name, parent;" | |
15 |