pg导入数据库,不要在本地,在黑窗口里面,原因-思考???

sc@sc-All-Series:~$ psql -h 192.168.31.157 -p 5432 #有误,正确见下面。
Password: 
psql: FATAL:  password authentication failed for user "sc"
FATAL:  password authentication failed for user "sc"
sc@sc-All-Series:~$ psql -h 192.168.31.157 -p 5432 decision_engine_dev  postgres
Password for user postgres: 
psql (9.5.12, server 9.5.3)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)
Type "help" for help.

decision_engine_dev=# use
decision_engine_dev-# \COPY t_shixin_predict_features TO '/home/sc/Downloads/staticdata/t_shixin_predict_features.csv' WITH csv;
COPY 493719
decision_engine_dev-# 


\COPY t_shixin_predict_features(company_name,established_years,industry_dx_rate,regcap_change_cnt,industry_dx_cnt,address_change_cnt,network_share_cancel_cnt,cancel_cnt,fr_change_cnt,network_share_zhixing_cnt,judgedoc_cnt,network_share_judge_doc_cnt,bidding_cnt,trade_mark_cnt,judge_doc_cnt,share_change_cnt,industry_all_cnt,shixin_label ) TO '/home/sc/Downloads/staticdata/t_shixin_predict_features.csv' WITH csv;


select * from public.t_add_shixin_predict_features;
select count(*) as num from public.t_add_shixin_predict_features;
select * from public.t_add_shixin_predict_features where id = '6f61cf38-5e0c-11e8-8ebe-9c5c8e925e38';
delete from t_add_shixin_predict_features where id = '6f61cf38-5e0c-11e8-8ebe-9c5c8e925e38';
select count(distinct(id)) as num  from t_add_shixin_predict_features;
copy (select *  from t_add_shixin_predict_features a
 where a.company_name not in (select company_name from t_shixin_predict_features)) to '/home/sc/PycharmProjects/risk-model/xg_test/statis_data/lost_shixin_company_name.csv' with csv header;


猜你喜欢

转载自blog.csdn.net/sinat_26566137/article/details/80388258