- Mastering PostGIS
- Dominik Mikiewicz Michal Mackiewicz Tomasz Nycz
- 297字
- 2021-07-02 22:52:20
Importing data using pgAdmin
In this section we'll import some new data we have not interacted with before - this time we'll have a look at the Ordnance Survey's address data we obtained in the CSV format.
For the examples involving pgAdmin, screenshots were taken using pgAdmin III (1.22.2).
PgAdmin's import functionality is basically a wrapper around the \COPY so it does require a data model in order to work. Because of that, let's quickly create a table that will be populated with the imported data. You can do it with the GUI by simply right-clicking a schema node you want to create the table in and choosing New Object | New Table and then providing all the necessary model definitions in the displayed window:

You can also type some SQL which in many cases is a bit quicker:
drop table if exists data_import.osgb_addresses;
create table data_import.osgb_addresses(
uprn bigint,
os_address_toid varchar,
udprn integer,
organisation_name varchar,
department_name varchar,
po_box varchar,
sub_building_name varchar,
building_name varchar,
building_number varchar,
dependent_thoroughfare varchar,
thoroughfare varchar,
post_town varchar,
dbl_dependent_locality varchar,
dependent_locality varchar,
postcode varchar,
postcode_type varchar,
x numeric,
y numeric,
lat numeric,
lon numeric,
rpc numeric,
country varchar,
change_type varchar,
la_start_date date,
rm_start_date date,
last_update_date date,
class varchar
);
Once our table is ready, importing data is just a matter of right clicking the table node in PgAdmin and choosing Import. An import wizard that assists with the import process will be displayed:

- 大學(xué)計(jì)算機(jī)基礎(chǔ):基礎(chǔ)理論篇
- Oracle SOA Governance 11g Implementation
- 輕松學(xué)C#
- 腦動(dòng)力:C語言函數(shù)速查效率手冊(cè)
- 一本書玩轉(zhuǎn)數(shù)據(jù)分析(雙色圖解版)
- 西門子S7-200 SMART PLC從入門到精通
- 大學(xué)C/C++語言程序設(shè)計(jì)基礎(chǔ)
- 嵌入式操作系統(tǒng)
- 網(wǎng)絡(luò)安全管理實(shí)踐
- 面向?qū)ο蟪绦蛟O(shè)計(jì)綜合實(shí)踐
- Docker on Amazon Web Services
- 單片機(jī)C語言程序設(shè)計(jì)完全自學(xué)手冊(cè)
- Godot Engine Game Development Projects
- 計(jì)算機(jī)組成與操作系統(tǒng)
- 單片機(jī)技術(shù)項(xiàng)目化原理與實(shí)訓(xùn)