example project: create 'cities' table and import data
This commit is contained in:
parent
fca4f3643c
commit
f4c0bd42a3
2 changed files with 23 additions and 0 deletions
10
examples/cities/pgsql/import_cities.sql
Normal file
10
examples/cities/pgsql/import_cities.sql
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
-- the input file is made accessible for the postgres process
|
||||||
|
-- via a symbolic link to to the storage-common package
|
||||||
|
|
||||||
|
copy cities
|
||||||
|
from '/var/lib/postgresql/data/storage-common/examples/cities/data/cities.csv'
|
||||||
|
with (
|
||||||
|
format csv,
|
||||||
|
header true
|
||||||
|
)
|
||||||
13
examples/cities/pgsql/init_cities.sql
Normal file
13
examples/cities/pgsql/init_cities.sql
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
|
||||||
|
create table cities (
|
||||||
|
rectype int,
|
||||||
|
ctype int,
|
||||||
|
regiokey text not null primary key,
|
||||||
|
ckey text not null,
|
||||||
|
name text,
|
||||||
|
area decimal,
|
||||||
|
inhabitants int,
|
||||||
|
zipcode text,
|
||||||
|
long decimal,
|
||||||
|
lat decimal
|
||||||
|
);
|
||||||
Loading…
Add table
Reference in a new issue