Shell Access Postgresql,copy Inbound, call function

Source: Internet
Author: User
Tags postgresql psql

SOURCE $HOME/.bash_profile

Pre_date= ' DATE + '%y-%m-%d "-D" -1days "'

If [$#-ne 0];then
pre_date=$1;
Fi

Python test5.py $PRE _date

echo "Delete from Lsb_cbh_test;" > Test1.sql
Psql "host=10.100.0.254 hostaddr=10.100.0.254 port=5433 user=sys_report password=report2hhl Dbname=sysreport"-F Test1.sql

#echo "\copy lsb_cbh_test from ' test_1.csv ' delimiter as ', ' null as ' null ';" >test.sql
echo "\copy lsb_cbh_test (type_id,cuid) from ' test11_new.txt ' delimiter as ', '; ' >test.sql
Psql "host=10.100.0.254 hostaddr=10.100.0.254 port=5433 user=sys_report password=report2hhl Dbname=sysreport"-F Test.sql

V_date= ' echo $PRE _date|sed ' s/-//g '
echo "Select Sp_stat_client_visit (' $v _date ');" >test2.sql
Psql "host=10.100.0.254 hostaddr=10.100.0.254 port=5433 user=sys_report password=report2hhl Dbname=sysreport"-F Test2.sql

Shell Access Postgresql,copy Inbound, call function

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.