当前位置:   article > 正文

pgloader 基本使用_pgloader 字段

pgloader 字段

导入csv:

  1. --type: 导入文件类型
  2. --field: 导入表的字段
  3. --with truncate:每次先删除表全部记录再新增,如果每次是增量导入,则不需要增加此选项
  4. --with "fields terminated by ','":字段值通过,分隔

实例1:

  1. pgloader --type csv
  2. --field "requirement_num,demand_schema_id,planning_schema_id,demand_state,period,construction_type_key,coverage_type_key,city_key,area_key,network_type_key,station_type_key,station_name,band,subordinate_area,subordinate_mesh,demand_longitude,demand_latitude,demand_radius,demand_reason,coverage_importance,demand_type,construction_type,construction_batch,construction_model,coverage_type,scene_type,coverage_range,coverage_scene,building_quantity,average_floor_num,detailed_address,is_transfer_reached,region_graph,region_area,problem_point_sn,problem_point_type,problem_line,gsm_cosite_planning_period,gsm_cosite_sitename,gsm_cosite_position,gsm_coaddress_station_status,td_cosite_planning_period,td_cosite_sitename,td_cosite_position,td_coaddress_station_status,lte_cosite_planning_period,lte_cosite_sitename,lte_cosite_position,lte_coaddress_station_status,td_scdma_cosite_sitename,other_cositename,regional_gsm_macro_traffic,regional_td_macro_traffic,regional_lte_macro_traffic,gsm_coverage_rate,gsm_rxlev,lte_coverage_rate,lte_rsrp,lte_rs_sinr,average_traffic,demand_site_source,peripheral_cell_count,station_type_coefficient,scene_factor,is_reserved_planning,creator,create_time,modifier,modify_time"
  3. --with truncate --with "fields terminated by ','"
  4. /home/adminz/Documents/pgloader/NPA_DE_COVER_POINT.csv
  5. postgres://postgres:root@10.9.20.211:25432/npas?tablename=public.npa_de_cover_point

实例中:

source为源文件:“/home/adminz/Documents/pgloader/NPA_DE_COVER_POINT.csv"

target为目标表: “postgres://postgres:root@10.9.20.211:25432/npas?tablename=public.npa_de_cover_point”

 

实例2:

  1. pgloader --type csv --field
  2. "CUID,\"E-UTRANCELL名称\",网管中网元名称,所属省,所属地市,所属区县,小区码CI,跟踪区码TAC,\"所属E-NODEBID\",\"所属E-NODEB\",\"所属机房/资源点\",生命周期状态,是否拉远小区,使用频段,覆盖类型,上下行子帧配比,特殊子帧时隙配比,PCI,覆盖场景,覆盖场景细化,入网时间,覆盖区域,中心载频的信道号,小区CGI,工程期数,创建时间,最后修改时间,创建人,最后修改人,所属类型,纬度,经度,路测纬度,路测经度,VIP级别,最后加入白名单时间,备注,最后采集时间,所属发射点,数据质量责任人,一线数据维护人,优化网格"
  3. -L "/home/adminz/Documents/csv/log/v_irms_mt_wireless_ltecell.log"
  4. --with truncate --with "skip header = 1" --with "batch rows=10000"
  5. --with "fields terminated by ','"
  6. /home/adminz/Documents/csv/V_IRMS_MT_WIRELESS_LTECELL.csv
  7. postgres://postgres:root@10.9.20.211:35432/npas055?tablename=zongzi.v_irms_mt_wireless_ltecell

 

参考资料:

https://pgloader.readthedocs.io/en/latest/quickstart.html

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/401314
推荐阅读
相关标签
  

闽ICP备14008679号