File tree Expand file tree Collapse file tree 3 files changed +55
-1
lines changed Expand file tree Collapse file tree 3 files changed +55
-1
lines changed Original file line number Diff line number Diff line change 7
7
#
8
8
#
9
9
# IDENTIFICATION
10
- # $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.11 1996/11/28 03:31:27 bryanh Exp $
10
+ # $Header: /cvsroot/pgsql/src/bin/pg_dump/Makefile,v 1.12 1997/01/16 15:28:21 momjian Exp $
11
11
#
12
12
# -------------------------------------------------------------------------
13
13
@@ -35,6 +35,7 @@ submake:
35
35
36
36
install : pg_dump
37
37
$(INSTALL ) $(INSTL_EXE_OPTS ) pg_dump $(DESTDIR )$(BINDIR ) /pg_dump
38
+ $(INSTALL ) $(INSTL_EXE_OPTS ) pg_dumpall $(DESTDIR )$(BINDIR ) /pg_dumpall
38
39
39
40
depend dep :
40
41
$(CC ) -MM $(INCLUDE_OPT ) * .c > depend
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ #
3
+ # pg_dumpall [pg_dump parameters]
4
+ # dumps all databases to standard output
5
+ # It also dumps the pg_user table
6
+ #
7
+ psql -l -A -q -t| unesc| cut -d" |" -f1 | grep -v ' ^template1$' | \
8
+ while read DATABASE
9
+ do
10
+ /bin/echo ' \connect template1'
11
+ /bin/echo " create database $DATABASE ;"
12
+ /bin/echo ' \connect' " $DATABASE "
13
+ pg_dump " $@ " $DATABASE
14
+ done
15
+ /bin/echo ' \connect template1'
16
+ /bin/echo ' copy pg_user from stdin;'
17
+ #
18
+ # Dump everyone but the postgres user
19
+ # initdb creates him
20
+ #
21
+ POSTGRES_SUPER_USER_ID=" ` psql -q template1 << END
22
+ \\ t
23
+ select datdba
24
+ from pg_database
25
+ where datname = 'template1';
26
+ END` "
27
+ psql -q template1 <<END
28
+ select pg_user.* into table tmp_pg_user
29
+ from pg_user
30
+ where usesysid <> $POSTGRES_SUPER_USER_ID ;
31
+ copy tmp_pg_user to stdout;
32
+ drop table tmp_pg_user;
33
+ END
34
+ /bin/echo '\.'
35
+
36
+
Original file line number Diff line number Diff line change
1
+ .\" This is -*-nroff-*-
2
+ .\" XXX standard disclaimer belongs here....
3
+ .\" $Header: /cvsroot/pgsql/src/man/Attic/pg_dumpall.1,v 1.1 1997/01/16 15:28:34 momjian Exp $
4
+ .TH pg_dumpall UNIX 1/20/96 PostgreSQL PostgreSQL
5
+ .SH NAME
6
+ pg_dumpall \(em dumps out all Postgres databases into a script file
7
+ .SH SYNOPSIS
8
+ .BR pg_dumpall
9
+ [pg_dump options]
10
+ .SH DESCRIPTION
11
+ .IR " pg_dumpall"
12
+ is a utility for dumping out all Postgres databases into one file.
13
+ It also dumps the pg_user table, which is global to all databases.
14
+ pg_dumpall takes all pg_dump options, but \fB -f \fR and \fB dbname \fR
15
+ should not be used.
16
+ .SH "SEE ALSO"
17
+ pg_dump(1)
You can’t perform that action at this time.
0 commit comments