Solved

copy/transfer postgre table

Posted on 2012-03-26
1
684 Views
Last Modified: 2012-04-11
I have a table in a postgreSQL DB I'd like to make an exact copy of and put in another postgreSQL DB. Using the same name, structure—everything identical.

Can anyone help me with the query I should use to do this? How can I expand it to do multiple tables at once?

Thanks!
0
Comment
Question by:hibbsusan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 43

Accepted Solution

by:
Eugene Z earned 500 total points
ID: 37770561
use insert into
e.g. code

insert into your table2
select * from table1

more
INSERT
http://www.postgresql.org/docs/8.2/static/sql-insert.html

--

also you may use COPY commund : to copy table data too \from  file
http://www.postgresql.org/docs/8.4/static/sql-copy.html
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question