Deleting records from a remote postgresql database using locally supplied list

后端 未结 1 668
暖寄归人
暖寄归人 2020-12-21 17:07

I have the following logic in a bash script that works:

 #copy records to delete file to respective servers.  faster than running locally
 scp -o StrictHostK         


        
相关标签:
1条回答
  • 2020-12-21 17:33

    You don't need to copy the file to the server. What you're looking for is the STDIN for COPY:

    cat records_to_delete.txt | psql $server -c "COPY tmp_widgets FROM STDIN;"
    
    0 讨论(0)
提交回复
热议问题