Search Postgresql Archives

Re: Dumping a table from one database and adding it to another

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/02/2010 12:49 PM, James B. Byrne wrote:
I have read the documentation respecting backups but I cannot seem
to find any mention of the specific case that I wish performed.

I have a pair of tables in a production database that I wish to dump
and then restore to a new, different database.  I can, and probably
will, recreate the tables and column layouts in the new database.

Is there a way to load the data dumped from a single table in one
database into a new, possibly differently named, table in a
different database, using PG utilities?



pg_dump -U postgres -a -t cell_per -f cell_per.sql production

From the head of the file,see inline comment ***:
--
-- PostgreSQL database dump
--

SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;

SET search_path = public, pg_catalog;

--
-- Data for Name: cell_per; Type: TABLE DATA; Schema: public; Owner: postgres
--

*** Change above to match new table or leave alone.

COPY cell_per (line_id, category, cell_per, type, ts_insert, ts_update, user_insert, user_update, plant_type, season, short_category) FROM stdin;


--
Adrian Klaver
adrian.klaver@xxxxxxxxx

--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux