将表数据从一个数据库复制到另一个数据库 [英] Copy table data from one database to another

查看:131
本文介绍了将表数据从一个数据库复制到另一个数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我的系统PostgreSQL 9.1版中有2个数据库
1)EssaePOS
2)TouchPOS

我想将所有数据从EssaePOS一个表复制到TouchPOS另一个表.
两个数据库的表名和列数相同.

我搜索了google.got名为pg_dump的东西,但没有得到如何使用它的信息.

谁能说出如何将一个表的数据复制到另一个表.

Hi all

I have 2 database in my system PostgreSQL ver 9.1
1)EssaePOS
2)TouchPOS

I want to copy all the data from EssaePOS one table to TouchPOS another table.
the table name and number of column is same for both the database.

I searched google.got something called pg_dump but not getting how to use that.

Can anyone tell how to copy table data from one table to other.

推荐答案

try
SELECT * INTO TouchPOS FROM EssaePOS

参考
http://www.postgresql.org/docs/9.1/static/sql-selectinto.html [^ ]

try
SELECT * INTO TouchPOS FROM EssaePOS

ref.
http://www.postgresql.org/docs/9.1/static/sql-selectinto.html[^]

if you want to copy a specific column set then into in not applicable.<br />
see this.


http: //stackstackflow.com/questions/17333994/如何将一个表的列复制到另一个表中的列在postgresql-comp [


http://stackoverflow.com/questions/17333994/how-to-copy-one-column-of-a-table-into-another-tables-column-in-postgresql-comp[^]


这篇关于将表数据从一个数据库复制到另一个数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆