pgpost 設置例
ttyp0:makoto@u 13:13:59/040408(...local-src/pgpost-1.3.2)> cd data
ttyp0:makoto@u 13:14:00/040408(...pgpost-1.3.2/data)> gmake create.sql
sed -e "s@_REPLACE_ME_@`pwd`@" create.source > create.sql
ttyp0:makoto@u 13:14:09/040408(...pgpost-1.3.2/data)> createdb postal
CREATE DATABASE
ttyp0:makoto@u 13:14:24/040408(...pgpost-1.3.2/data)> psql -e postal < create.sql
drop table postal;
ERROR: table "postal" does not exist
create table postal (
oldcode varchar(5),
newcode char(7),
pid int2,
kana_city text,
kana_town text,
city text,
town text
);
CREATE TABLE
drop table prefecture;
ERROR: table "prefecture" does not exist
create table prefecture (
pid int2,
pref char(8),
kana_pref char(16)
);
CREATE TABLE
copy postal from '/export/local-src/pgpost-1.3.2/data/postal.data';
CREATE TABLE
drop table prefecture;
ERROR: table "prefecture" does not exist
DROP TABLE
create table prefecture (
pid int2,
pref char(8),
kana_pref char(16)
);
CREATE TABLE
copy postal from '/export/local-src/pgpost-1.3.2/data/postal.data';
COPY
copy prefecture from '/export/local-src/pgpost-1.3.2/data/prefecture.data';
COPY
create index oldcodeindex on postal using btree(oldcode);
CREATE INDEX
create index newcodeindex on postal using btree(newcode);
CREATE INDEX
create index pidindex on postal using btree(pid);
CREATE INDEX
create index cityindex on postal using btree(city);
CREATE INDEX
create index townindex on postal using btree(town);
CREATE INDEX
create index kana_cityindex on postal using btree(kana_city);
CREATE INDEX
create index kana_townindex on postal using btree(kana_town);
CREATE INDEX
create index prefpidindex on prefecture using btree(pid);
|