Project

General

Profile

1
#!/bin/sh
2
# Dumps a schema of the vegbien db
3

    
4
selfDir="$(dirname -- "$0")"
5

    
6
if ! test "$#" -eq 1; then
7
    echo "Usage: env [schema=1] [data=1] [plain=1] [owners=1] [opts=...] $0 \
8
{<schema>|all} [opts...] >out"|fold -s >&2
9
    exit 2
10
fi
11

    
12
schema_="$1"
13
shift
14
test "$schema_" != all && set -- --schema="\"$schema_\"" "$@"
15

    
16
if test -n "$data"; then
17
    if test -n "$plain"; then set -- "$@" --format=p
18
    else set -- "$@" --format=c --compress=9
19
    fi
20
    owners=1
21
elif test -n "$schema"; then set -- "$@" --schema-only
22
fi
23
test -n "$owners" || set -- "$@" --no-owner --no-privileges
24
set -- "$@" $opts
25

    
26
set -x
27
exec "$selfDir/postgres_vegbien" pg_dump "$@"
(38-38/62)