install-osrf.sh: set ejabberd host correctly during registration on prod
[sitka/sitka-tools.git] / marc_export_custom / fetch-shortcodes.sh
1 #!/bin/bash 
2 SHORTCODES=$1
3 if [ -z "${SHORTCODES}" ]; then
4     SHORTCODES="shortcodes.csv"
5 fi
6 psql -Upostgres -U evergreen evergreen -h prod-pg94-db2-sitka.sitka.bclibraries.ca -o $SHORTCODES \
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