正确的psql COPY命令用于传输表数据?

时间:2016-06-24 13:43:05

标签: sql c postgresql libpq

我正在编写一些c代码来将数据从database_1,table_1传输到database_2,table_2。我对postgresql很新,无法弄清楚如何做到这一点。我正在使用postgres-9.5

以下语法是否正确?

psql database_1 -c 'COPY table_1 TO stdout' | psql database_2 -c 'COPY table_2 FROM stdin'

这里的聪明人,请帮我正确的语法。提前谢谢!!

1 个答案:

答案 0 :(得分:0)

不确定为什么你不尝试自己,但是 - 这应该有效:

Logger.ts(6,24): Error TS2461: Type 'IArguments' is not an array type.