Skip to content
Snippets Groups Projects
Select Git revision
  • benchmark-tools
  • postgres-lambda
  • master default
  • REL9_4_25
  • REL9_5_20
  • REL9_6_16
  • REL_10_11
  • REL_11_6
  • REL_12_1
  • REL_12_0
  • REL_12_RC1
  • REL_12_BETA4
  • REL9_4_24
  • REL9_5_19
  • REL9_6_15
  • REL_10_10
  • REL_11_5
  • REL_12_BETA3
  • REL9_4_23
  • REL9_5_18
  • REL9_6_14
  • REL_10_9
  • REL_11_4
23 results

pg_dump.1

Blame
  • pg_dump.1 2.68 KiB
    .\" This is -*-nroff-*-
    .\" XXX standard disclaimer belongs here....
    .\" $Header: /cvsroot/pgsql/src/man/Attic/pg_dump.1,v 1.7 1997/10/30 03:59:59 momjian Exp $
    .TH PG_DUMP UNIX 1/20/96 PostgreSQL PostgreSQL
    .SH NAME
    pg_dump \(em dumps out a Postgres database into a script file
    .SH SYNOPSIS
    .BR pg_dump
    [\c
    .BR "-f"
    filename
    ]
    [\c
    .BR "-h"
    hostname
    ]
    [\c
    .BR "-p"
    port]
    [\c
    .BR "-v"
    ]
    [\c
    .BR "-d"
    ]
    [\c
    .BR "-D"
    ]
    [\c
    .BR "-S"
    help]
    [\c
    .BR "-a"
    ]
    [\c
    .BR "-t"
    table]
    [\c
    .BR "-o"
    ]
    dbname
    .in -5n
    .SH DESCRIPTION
    .IR "pg_dump"
    is a utility for dumping out a 
    Postgres database into a script file containing query commands.  The script
    files are in a ASCII format and can be used to reconstruct the database,
    even on other machines and other architectures.  
    .IR "pg_dump" 
    will produce the queries necessary to re-generate all
    user-defined types, functions, tables, indices, aggregates, and
    operators.  In addition, all the data is copied out in ASCII format so
    that it can be readily copied in again, as well, as imported into tools
    for textual editing.
    .PP
    .IR "pg_dump" 
    is useful for dumping out the contents of a database to move from one
    postgreSQL installation to another.  After running 
    .IR "pg_dump"
    , one should examine the output script file for any warnings, especially
    in light of the limitations listed below. 
    .PP
    pg_dump understands the following options:
    .TP
    .BR "-f" " filename"
    Specifies the output file
    .TP
    .BR "-h" " hostname"
    Specifies the server host name
    .TP
    .BR "-p" " port"
    Specifies the server port number
    .TP
    .BR "-v" ""
    Specifies verbose mode
    .TP
    .BR "-d" ""
    Dump data as proper insert strings
    .TP
    .BR "-D" ""
    Dump data as inserts with attribute names
    .TP
    .BR "-S" ""
    Dump out only the schema, no data
    .TP
    .BR "-a" ""
    Dump out only the data, no schema
    .TP
    .BR "-t" " table"
    Dump for this table only
    .TP
    .BR "-o" ""
    Dump object id's (oids)
    .PP
    If dbname is not supplied, then the DATABASE environment variable value is used.
    .SH "CAVEATS AND LIMITATIONS"
    .IR pg_dump 
    has a few limitations.
    The limitations mostly stem from
    difficulty in extracting certain meta-information from the system
    catalogs.   
    .TP
    .BR "rules and views"
    pg_dump does not understand user-defined rules and views and
    will fail to dump them properly.  (This is due to the fact that
    rules are stored as plans in the catalogs and not textually)
    .TP
    .BR "partial indices"
    pg_dump does not understand partial indices. (The reason is
    the same as above.  Partial index predicates are stored as plans)
    .TP
    .BR "large objects"
    pg_dump does not handle large objects.  Large objects are ignored and
    must be dealt with manually. 
    .SH EXAMPLES
    .nf
    To dump a database:
    
    	pg_dump >db.out
    
    To reload it:
    
    	psql -e database <db.out
    
    .SH "SEE ALSO"
    copy(l)