• 来迁移数据管道



    磁盘空间不足的条件,使用命名管道或匿名的迁移和进口数据;请注意,命名管道必须权限问题。



    0. Name PIP 0
    [pg@h1 ~]$ psql gtlions -ac "select 't3' tab,count(*) from t3 union all select 't4',count(*) from t4;"
    select 't3' tab,count(*) from t3 union all select 't4',count(*) from t4;
     tab | count
    -----+-------
     t3  |   100
     t4  |     0
    (2 rows)
     
    [pg@h1 ~]$ mknod syncpip p
    [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/sync'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/sync'"  
    ERROR:  could not open file "/home/pg/sync" for reading: No such file or directory
    [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/syncpip'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/syncpip'"  
    COPY 100
    [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/syncpip'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/syncpip'"        
    COPY 100
    [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/syncpip'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/syncpip'"  
    COPY 100
    [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/syncpip'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/syncpip'"  
    COPY 100
    [pg@h1 ~]$ psql gtlions -ac "select 't3' tab,count(*) from t3 union all select 't4',count(*) from t4;"
    select 't3' tab,count(*) from t3 union all select 't4',count(*) from t4;
     tab | count
    -----+-------
     t3  |   100
     t4  |   400
    (2 rows)
    1. Name PIP 1
    [pg@h1 ~]$ rm -rf sync*
    [pg@h1 ~]$ mkfifo syncpip
    [pg@h1 ~]$ ll syncpip
    prw-rw-r-- 1 pg pg 0 11月  6 09:15 syncpip
    [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/syncpip'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/syncpip'"  
    COPY 100
    [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/syncpip'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/syncpip'"  
    COPY 100
    [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/syncpip'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/syncpip'"  
    COPY 100
    [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/syncpip'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/syncpip'"  
    COPY 100
    [pg@h1 ~]$ psql gtlions -ac "select 't3' tab,count(*) from t3 union all select 't4',count(*) from t4;"
    select 't3' tab,count(*) from t3 union all select 't4',count(*) from t4;
     tab | count
    -----+-------
     t3  |   100
     t4  |   800
    (2 rows)
     
    2. UnName PIP
    [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to stdout"|psql gtlions -p 5432 -c "copy t4 from stdin"                                      
    [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to stdout"|psql gtlions -p 5432 -c "copy t4 from stdin"  
    [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to stdout"|psql gtlions -p 5432 -c "copy t4 from stdin"  
    [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to stdout"|psql gtlions -p 5432 -c "copy t4 from stdin"  
    [pg@h1 ~]$ psql gtlions -p 5432 -c "copy t3 to '/home/pg/syncpip'"|psql gtlions -p 5432 -c "copy t4 from '/home/pg/syncpip'"  
    COPY 100
    [pg@h1 ~]$ psql gtlions -ac "select 't3' tab,count(*) from t3 union all select 't4',count(*) from t4;"                        
    select 't3' tab,count(*) from t3 union all select 't4',count(*) from t4;
     tab | count
    -----+-------
     t3  |   100
     t4  |  1300
    (2 rows)


    -EOF-
  • 相关阅读:
    js post 异步请求
    Android 实现文件上传功能(upload)
    js 金额文本框实现代码
    纯CSS画的基本图形(矩形、圆形、三角形、多边形、爱心、八卦等)
    NBearV2视频教学系列总索引,欢迎多提意见和建议[09/21更新至IoC篇]
    1.2 实体实例化及使用自定义实体[发布时间:9/6]
    NBear视频 4.1 基于NBear.IoC的企业级系统构架[发布时间:9/21]
    2.1 基于NBear.Data的实体持久化[发布时间:9/10]
    NBear案例源码 简易AJAX留言板 [Updated 10/31 Powered by NBear V3.0.0 preview]
    全面解析ASP.NET2.0下的URL重写
  • 原文地址:https://www.cnblogs.com/blfshiye/p/4563678.html
Copyright © 2020-2023  润新知