Thread: Dump to text file

Dump to text file

From
"Mike Hammonds"
Date:
** Reply Requested When Convenient **

How do I dump a database to a text file from the command line?

Mike Hammonds, CNE5, MCP-NT
Fellon-McCord & Associates, Inc.
Office:  502.214-6324
Fax:      502.426.8800
mhammonds@knowledgeinenergy.com
Show Me the Code!!


Attachment

Re: Dump to text file

From
Mauricio Alarcon
Date:
with pg_dump, I use in this form

pg_dump mydb > mydb.pg_dump

pg_dump dumps a database as a text file.

Usage:
  pg_dump [options] dbname

Options:
  -a, --data-only          dump out only the data, not the schema
  -c, --clean              clean (drop) schema prior to create
  -d, --inserts            dump data as INSERT, rather than COPY, commands
  -D, --attribute-inserts  dump data as INSERT commands with attribute names
  -h, --host <hostname>    server host name
  -i, --ignore-version     proceed when database version != pg_dump version
  -n, --no-quotes          suppress most quotes around identifiers
  -N, --quotes             enable most quotes around identifiers
  -o, --oids               dump object ids (oids)
  -p, --port <port>        server port number
  -s, --schema-only        dump out only the schema, no data
  -t, --table <table>      dump for this table only
  -u, --password           use password authentication
  -v, --verbose            verbose
  -x, --no-acl             do not dump ACL's (grant/revoke)

If no database name is not supplied, then the PGDATABASE environment
variable value is used.

Mike Hammonds wrote:

> ** Reply Requested When Convenient **
>
> How do I dump a database to a text file from the command line?
>
> Mike Hammonds, CNE5, MCP-NT
> Fellon-McCord & Associates, Inc.
> Office:  502.214-6324
> Fax:      502.426.8800
> mhammonds@knowledgeinenergy.com
> Show Me the Code!!
>
>
> ------------------------------------------------------------------------
>
> BEGIN:VCARD
> VERSION:2.1
> X-GWTYPE:USER
> FN:Mike Hammonds
> TEL;WORK:(502)214-6324
> ORG:;IS Department
> TEL;PREF;FAX:(502)426-8800
> EMAIL;WORK;PREF;NGW:Mike.Hammonds@knowledgeinenergy.com
> N:Hammonds;Mike
> TITLE:IS MAnager
> X-GWUSERID:mhammonds
> END:VCARD
>
> attachment.txt
>
> Content-Type:
>
> text/plain
> Content-Encoding:
>
> quoted-printable
>
>
> ------------------------------------------------------------------------
> Mike Hammonds.vcf
>
> Content-Type:
>
> text/plain
>
>

--
Mauricio Alarcon Rincon
Webmaster - Webdepot
    CF-18 Hornet
                \     /
                 \ _ /
              ----/_\----
  x--------------( . )--------------x
       x|x   | |_|\_/|_| |   x|x
        x    x           x    x


Re: Dump to text file

From
GH
Date:
On Wed, Jan 03, 2001 at 10:13:06AM -0500, some SMTP stream spewed forth:
> ** Reply Requested When Convenient **
>
> How do I dump a database to a text file from the command line?

http://www.postgresql.org/
  -> User's Lounge
   -> Documentation -> English
    -> Current Release Docs
     -> Online version of the Administrator's Guide
      -> Ch. 11 Managing a Database -> Backup and Restore

 http://www.postgresql.org/users-lounge/docs/7.0/admin/manage-ag1655.htm

Nyeh.
The doc page is kinda skimpy, but a `man pg_dump` should help.
(You will probably want to make sure that the PgSQL man pages are
in you manpage path stuff.)


gh

>
> Mike Hammonds, CNE5, MCP-NT
> Fellon-McCord & Associates, Inc.
> Office:  502.214-6324
> Fax:      502.426.8800
> mhammonds@knowledgeinenergy.com
> Show Me the Code!!
>

> BEGIN:VCARD
> VERSION:2.1
> X-GWTYPE:USER
> FN:Mike Hammonds
> TEL;WORK:(502)214-6324
> ORG:;IS Department
> TEL;PREF;FAX:(502)426-8800
> EMAIL;WORK;PREF;NGW:Mike.Hammonds@knowledgeinenergy.com
> N:Hammonds;Mike
> TITLE:IS MAnager
> X-GWUSERID:mhammonds
> END:VCARD
>