【问题标题】:Unable to copy postgresql table in another database无法在另一个数据库中复制 postgresql 表
【发布时间】:2013-06-08 07:14:36
【问题描述】:

当我在 pgAdmin 3 中编写此查询时,我尝试将 postgresql 表复制到另一个数据库中

$pg_dump -t pl_biz_enhanced business_catalog | psql business_catalog_enhanced

这里 pl_biz_enhanced 是我要复制的表,business_catalog 是该表所在的数据库

但我在 $ 附近收到语法错误。

【问题讨论】:

    标签: postgresql-9.1 phppgadmin


    【解决方案1】:

    这不是 SQL 查询。

    $pg_dump -t pl_biz_enhanced business_catalog | psql business_catalog_enhanced
    

    $ 是对 UNIX shell 提示符的引用,通常以 $ 结尾。

    这是一个shell命令。你不能在 PgAdmin-III 中运行它。

    据我所知,PgAdmin-III 中没有等效的功能。在命令提示符下执行 pg_dump | pg_restore 或在 PgAdmin-III 中手动执行等效操作,即仅转储 business_catalogpl_biz_enhanced 表,然后将其还原到单独的数据库 business_catalog_enhanced

    【讨论】:

    • 谢谢 - 我尝试在 't pgadmin 中备份和恢复,但它不起作用
    猜你喜欢
    • 1970-01-01
    • 2017-06-03
    • 2017-01-22
    • 1970-01-01
    • 2016-07-28
    • 2021-05-28
    • 2011-12-22
    • 1970-01-01
    • 2022-01-25
    相关资源
    最近更新 更多