Re: Detaching database - Mailing list pgsql-general

From Dann Corbit
Subject Re: Detaching database
Date
Msg-id D425483C2C5C9F49B5B7A41F8944154757D3BC@postal.corporate.connx.com
Whole thread Raw
In response to Detaching database  ("Petr" <pjsoft@volny.cz>)
List pgsql-general
Pg_dump followed by pg_restore is the usual way:
========================================================
pg_dump dumps a database as a text file or to other formats.

Usage:
  pg_dump [OPTION]... [DBNAME]

General options:
  -f, --file=FILENAME      output file name
  -F, --format=c|t|p       output file format (custom, tar, plain text)
  -i, --ignore-version     proceed even when server version mismatches
                           pg_dump version
  -v, --verbose            verbose mode
  -Z, --compress=0-9       compression level for compressed formats
  --help                   show this help, then exit
  --version                output version information, then exit

Options controlling the output content:
  -a, --data-only          dump only the data, not the schema
  -c, --clean              clean (drop) schema prior to create
  -C, --create             include commands to create database in dump
  -d, --inserts            dump data as INSERT, rather than COPY,
commands
  -D, --column-inserts     dump data as INSERT commands with column
names
  -E, --encoding=ENCODING  dump the data in encoding ENCODING
  -n, --schema=SCHEMA      dump the named schema only
  -o, --oids               include OIDs in dump
  -O, --no-owner           skip restoration of object ownership
                           in plain text format
  -s, --schema-only        dump only the schema, no data
  -S, --superuser=NAME     specify the superuser user name to use in
                           plain text format
  -t, --table=TABLE        dump the named table only
  -x, --no-privileges      do not dump privileges (grant/revoke)
  -X disable-dollar-quoting, --disable-dollar-quoting
                           disable dollar quoting, use SQL standard
quoting
  -X disable-triggers, --disable-triggers
                           disable triggers during data-only restore
  -X use-set-session-authorization, --use-set-session-authorization
                           use SESSION AUTHORIZATION commands instead of
                           OWNER TO commands

Connection options:
  -h, --host=HOSTNAME      database server host or socket directory
  -p, --port=PORT          database server port number
  -U, --username=NAME      connect as specified database user
  -W, --password           force password prompt (should happen
automatically)

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

Report bugs to <pgsql-bugs@postgresql.org>.
========================================================
pg_restore restores a PostgreSQL database from an archive created by
pg_dump.

Usage:
  pg_restore [OPTION]... [FILE]

General options:
  -d, --dbname=NAME        connect to database name
  -f, --file=FILENAME      output file name
  -F, --format=c|t         specify backup file format
  -i, --ignore-version     proceed even when server version mismatches
  -l, --list               print summarized TOC of the archive
  -v, --verbose            verbose mode
  --help                   show this help, then exit
  --version                output version information, then exit

Options controlling the restore:
  -a, --data-only          restore only the data, no schema
  -c, --clean              clean (drop) schema prior to create
  -C, --create             create the target database
  -I, --index=NAME         restore named index
  -L, --use-list=FILENAME  use specified table of contents for ordering
                           output from this file
  -n, --schema=NAME        restore only objects in this schema
  -O, --no-owner           skip restoration of object ownership
  -P, --function=NAME(args)
                           restore named function
  -s, --schema-only        restore only the schema, no data
  -S, --superuser=NAME     specify the superuser user name to use for
                           disabling triggers
  -t, --table=NAME         restore named table
  -T, --trigger=NAME       restore named trigger
  -x, --no-privileges      skip restoration of access privileges
(grant/revoke)
  -X disable-triggers, --disable-triggers
                           disable triggers during data-only restore
  -X use-set-session-authorization, --use-set-session-authorization
                           use SESSION AUTHORIZATION commands instead of
                           OWNER TO commands

Connection options:
  -h, --host=HOSTNAME      database server host or socket directory
  -p, --port=PORT          database server port number
  -U, --username=NAME      connect as specified database user
  -W, --password           force password prompt (should happen
automatically)
  -e, --exit-on-error      exit on error, default is to continue

If no input file name is supplied, then standard input is used.

Report bugs to <pgsql-bugs@postgresql.org>.
========================================================
What exactly is the problem you are trying to solve?  I am guessing that
there is a tool that does exactly what you want if you can describe your
need carefully enough.

Maybe you need Slony or something else like that.
http://gborg.postgresql.org/project/slony1/projdisplay.php

But it is very hard to say from the brief description of what you want.

> -----Original Message-----
> From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-
> owner@postgresql.org] On Behalf Of Petr
> Sent: Tuesday, December 27, 2005 3:40 PM
> To: pgsql-general@postgresql.org
> Subject: [GENERAL] Detaching database
>
> Hi.
>
> Is any way how to detach complete database, and attach it into other
> Postgre
> server (like MSSQL, Interbase etc. databases movability) ?
> Moving database via SQL export is crazy way for me (and for my
customers).
>
> Thanks and forgive me for my poor english.
>
> Petr
>
>
> ---------------------------(end of
broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings

pgsql-general by date:

Previous
From: "Petr"
Date:
Subject: Detaching database
Next
From: "Gregory S. Williamson"
Date:
Subject: Re: Detaching database