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 [data=1] [plain=1] [owners=1] $0 [schema] [opts...] >out"
8
    exit 2
9
fi
10

    
11
if test "${1#-}" = "$1"; then # $1 does not start with "-"
12
    schemaOpt=--schema="\"$1\""
13
    shift
14
    set -- "$schemaOpt" "$@"
15
fi
16

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

    
27
set -x
28
exec "$selfDir/postgres_vegbien" pg_dump "$@"
(28-28/52)