From f4c0bd42a346739069e352a87279d95f53e7ee0d Mon Sep 17 00:00:00 2001 From: Helmut Merz Date: Tue, 18 Feb 2020 11:57:24 +0100 Subject: [PATCH] example project: create 'cities' table and import data --- examples/cities/pgsql/import_cities.sql | 10 ++++++++++ examples/cities/pgsql/init_cities.sql | 13 +++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 examples/cities/pgsql/import_cities.sql create mode 100644 examples/cities/pgsql/init_cities.sql diff --git a/examples/cities/pgsql/import_cities.sql b/examples/cities/pgsql/import_cities.sql new file mode 100644 index 0000000..692d1b9 --- /dev/null +++ b/examples/cities/pgsql/import_cities.sql @@ -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 + ) \ No newline at end of file diff --git a/examples/cities/pgsql/init_cities.sql b/examples/cities/pgsql/init_cities.sql new file mode 100644 index 0000000..0f034e2 --- /dev/null +++ b/examples/cities/pgsql/init_cities.sql @@ -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 +);