CREATE SEQUENCE kid_s start 39 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
SELECT nextval ('kid_s');
CREATE SEQUENCE rid_s start 117 increment 1 maxvalue 2147483647 minvalue 1  cache 1 ;
SELECT nextval ('rid_s');
CREATE TABLE emp (mid int4, name text, ort text);
CREATE TABLE entfern (von text, nach text, km int4);
CREATE TABLE rkdiff (rid int4, mid int4, weg text, entf int4, stkm float4, plkm float4);
CREATE TABLE reise (rid int4, mid int4, kid int4, weg text, begt datetime, endt datetime, ueb float4, nek float4, net text, bem text);
CREATE TABLE kunden (kid int4, kname text, abt text, addr text, land text);
CREATE TABLE pausch (land text, gendt datetime, lt14 float4, lt24 float4, eq24 float4, un float4, stkm float4, plkm float4, gbegt datetime);
CREATE TABLE tcodes (t1 int4, t2 int4, guelt datetime, txt text);
CREATE TABLE tage (mid int4, begt datetime, endt datetime, kunde_old text, pausen timespan, taet int4, proj int4, atag float4, stag float4, kzv int4, bem text DEFAULT 'Keine', kid int4);
CREATE TABLE tmp (id oid, begt datetime, endt datetime);
CREATE  INDEX reise_3 on reise using btree ( mid int4_ops );
CREATE UNIQUE INDEX kunden_0 on kunden using btree ( kid int4_ops );
CREATE UNIQUE INDEX reise_1 on reise using btree ( begt datetime_ops );
CREATE UNIQUE INDEX tage_0 on tage using btree ( mid int4_ops, begt datetime_ops, endt datetime_ops );
CREATE UNIQUE INDEX rkdiff_0 on rkdiff using btree ( rid int4_ops );
CREATE UNIQUE INDEX emp_0 on emp using btree ( mid int4_ops );
CREATE UNIQUE INDEX reise_0 on reise using btree ( rid int4_ops );
CREATE UNIQUE INDEX reise_2 on reise using btree ( endt datetime_ops );
CREATE UNIQUE INDEX tcodes_0 on tcodes using btree ( t1 int4_ops, t2 int4_ops, guelt datetime_ops );
CREATE UNIQUE INDEX pausch_0 on pausch using btree ( land text_ops, gbegt datetime_ops, gendt datetime_ops );
CREATE  INDEX reise_4 on reise using btree ( kid int4_ops );
CREATE UNIQUE INDEX entfern_0 on entfern using btree ( von text_ops, nach text_ops );
CREATE  INDEX kunden_1 on kunden using btree ( land text_ops );
CREATE  INDEX tage_1 on tage using btree ( kid int4_ops );
