By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 1,960 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

need copy table sql example in postgres

P: 1
hi all


i use postgresql database.

There are two databases in that namely 'db1','db2'.

In 'db1', thers is a table named as 'table_common'.

In 'db2', there is a table named as 'table_common'.

In both databases, the table 'table_common' is identical with fields.

In 'db1', the 'table_common' has data(1000 rows). But in 'db2', the table has no data(0rows).

I am in situation to use 'copy table' sql here.

please help me to copy data of table_common in db1 to table_common in db2.

very urgent.

Advance thanks.

N.Prabhu
Mar 1 '07 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 534
If this is a one-time operation you can use pg_dump to create the datafile off this table, then you can load this file into another database.
If you need this functionality on a permanent basis you can use dblink:

http://www.postgresql.org/docs/8.0/i...pressions.html
http://developer.postgresql.org/cvsw...ontrib/dblink/
http://pgfoundry.org/projects/dblink-tds/
Mar 1 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.