Revision 3400
Added by Aaron Marcuse-Kubitza over 12 years ago
bin/pg_dump_vegbien | ||
---|---|---|
4 | 4 |
selfDir="$(dirname -- "$0")" |
5 | 5 |
|
6 | 6 |
if ! test "$#" -eq 1; then |
7 |
echo "Usage: env [data=1] [plain=1] [owners=1] $0 schema >schema.sql"
|
|
7 |
echo "Usage: env [data=1] [plain=1] [owners=1] $0 [schema] [opts...] >out"
|
|
8 | 8 |
exit 2 |
9 | 9 |
fi |
10 | 10 |
|
11 |
if test "${1#-}" = "$1"; then # $1 does not start with "-" |
|
12 |
schemaOpt=--schema="\"$1\"" |
|
13 |
shift |
|
14 |
set -- "$schemaOpt" "$@" |
|
15 |
fi |
|
16 |
|
|
11 | 17 |
if test -n "$data"; then |
12 | 18 |
if test -n "$plain"; then dataOpts=--format=p |
13 | 19 |
else dataOpts='--format=c --compress=9' |
... | ... | |
17 | 23 |
fi |
18 | 24 |
test -n "$owners" && ownerOpts= || ownerOpts='--no-owner --no-privileges' |
19 | 25 |
|
20 |
(set -x; "$selfDir/../bin/postgres_vegbien" pg_dump --schema="\"$1\"" \
|
|
26 |
(set -x; "$selfDir/../bin/postgres_vegbien" pg_dump "$@" \
|
|
21 | 27 |
$dataOpts $ownerOpts --use-set-session-authorization) |
Also available in: Unified diff
pg_dump_vegbien: Pass command line options directly to pg_dump after parsing out any schema name