CREATE TABLE kockazat_felmero
(
   "kockazat_felmero_kod" serial NOT NULL,
   "kockazat_felmero_pkod" int4 NOT NULL,
   "kockazat_felmero_tkod" int4 NOT NULL,
   "nev" varchar(80),
   "technologia" varchar(200),
   "datum_kelt" date,
   "tev_nev" varchar(200),
   "tev_fno" int4,
   "tev_fferfi" int4,
   "tev_ffiatal" int4,
   "tev_sno" int4,
   "tev_sferfi" int4,
   "tev_sfiatal" int4,
   "tev_kezmosas" varchar(50),
   "tev_oltozo" varchar(50),
   "tev_futes" varchar(50),
   "tev_vilagitas" varchar(50),
   "tev_vmeres" varchar(50),
   "tev_mszellozes" varchar(50),
   "tev_tszellozes" varchar(50),
   "tev_munkaido" varchar(10),
   "tev_muszak" varchar(10),
   "tev_gepek" text,
   "mk_allo" varchar(2),
   "mk_jaro" varchar(2),
   "mk_terdelo" varchar(2),
   "mk_ulo" varchar(2),
   "mk_egyeb" varchar(2),
   "mk_kenyszertest" bool DEFAULT false,
   "mk_ismetlodo" bool DEFAULT false,
   "mk_pszicho" bool DEFAULT false,
   "mk_infterh" bool DEFAULT false,
   "mk_jellemzes" varchar(200),
   "mk_idotartam" varchar(6),
   "kli_meres" bool DEFAULT false,
   "kli_effektiv" varchar(10),
   "kli_korrigalt" varchar(10),
   "kli_kulso" varchar(10),
   "kli_napi" varchar(10),
   "kli_munkakli"varchar(50),
   "veg_expozicio" varchar(20),
   "veg_jelentes" bool DEFAULT false,
   "veg_kno" int4,
   "veg_kferfi" int4,
   "veg_kfiatal" int4,
   "veg_klno" int4,
   "veg_klferfi" int4,
   "veg_klfiatal" int4,
   "veg_raktar" varchar(50),
   "veg_szallitas" varchar(50),
   "veg_legter" varchar(20),
   "veg_munkaido" varchar(10),
   "bio_expozicio" bool DEFAULT false,
   "bio_lehetoseg" varchar(20),
   "bio_tipus" varchar(20),
   "bio_kno" int4,
   "bio_kferfi" int4,
   "bio_kfiatal" int4,
   "bio_klno" int4,
   "bio_klferfi" int4,
   "bio_klfiatal" int4,
   "bio_munkaido" varchar(10),
   "por_expozicio" bool DEFAULT false,
   "por_mert" varchar(20),
   "por_munkaido" varchar(10),
   "bio_muszak" varchar(10),
   "por_kno" int4,
   "por_kferfi" int4,
   "por_kfiatal" int4,
   "por_klno" int4,
   "por_klferfi" int4,
   "por_klfiatal" int4,
   "zaj_expozicio" bool DEFAULT false,
   "zaj_mert" varchar(20),
   "zaj_munkaido" varchar(10),
   "zaj_kno" int4,
   "zaj_kferfi" int4,
   "zaj_kfiatal" int4,
   "zaj_klno" int4,
   "zaj_klferfi" int4,
   "zaj_klfiatal" int4,
   "vib_expozicio" bool DEFAULT false,
   "vib_mert" varchar(20),
   "vib_munkaido" varchar(10),
   "vib_kno" int4,
   "vib_kferfi" int4,
   "vib_kfiatal" int4,
   "vib_klno" int4,
   "vib_klferfi" int4,
   "vib_klfiatal" int4,
   "sug_expozicio" bool DEFAULT false,
   "sug_tipus" varchar(50),
   "sug_mert" varchar(20),
   "sug_munkaido" varchar(10),
   "sug_e_kno" int4,
   "sug_e_kferfi" int4,
   "sug_e_kfiatal" int4,
   "sug_e_klno" int4,
   "sug_e_klferfi" int4,
   "sug_e_klfiatal" int4,
   "sug_k_kno" int4,
   "sug_k_kferfi" int4,
   "sug_k_kfiatal" int4,
   "sug_k_klno" int4,
   "sug_k_klferfi" int4,
   "sug_k_klfiatal" int4,
   "eve_fej" varchar(200),
   "eve_arc" varchar(200),
   "eve_szem" varchar(200),
   "eve_legzes" varchar(200),
   "eve_hallas" varchar( 200),
   "eve_test" varchar( 200),
   "eve_etest" varchar(200),
   "eve_kez" varchar(200),
   "eve_lab" varchar(200),
   "eve_egyeb" varchar(200),
   "tabla" varchar(56),
   "vib_fajta" varchar(20),
   "bio_gomba" bool DEFAULT false,
   "bio_parazita" bool DEFAULT false,
   "bio_virus" bool DEFAULT false,
   "bio_bakterium" bool DEFAULT false,
   "sug_ir" bool DEFAULT false,
   "sug_uv" bool DEFAULT false,
   "sug_xray" bool DEFAULT false,
   "sug_elektromos" bool DEFAULT false,
   "psz_pszicho" bool DEFAULT false,
   "psz_kno" int4,
   "psz_kferfi" int4,
   "psz_kfiatal" int4,
   "psz_kidos" int4,
   "psz_klno" int4,
   "psz_klferfi" int4,
   "psz_klfiatal" int4,
   "psz_klidos" int4,
   "adatszolgaltato" varchar(80),
   "por_azbeszt" bool DEFAULT false,
   "por_ugyapot" bool DEFAULT false,
   "por_tudofibr" bool DEFAULT false,
   "por_egyeb" bool DEFAULT false,
   "por_k_egyeb" varchar(250),
   "veg_novenyv" varchar(250),
   "veg_k_arzen" bool DEFAULT false,
   "veg_k_benzol" bool DEFAULT false,
   "veg_k_benzola" bool DEFAULT false,
   "veg_k_benzoln" bool DEFAULT false,
   "veg_k_dimetil" bool DEFAULT false,
   "veg_k_dioxan" bool DEFAULT false,
   "veg_k_etilen" bool DEFAULT false,
   "veg_k_etileno" bool DEFAULT false,
   "veg_k_higany" bool DEFAULT false,
   "veg_k_mangan" bool DEFAULT false,
   "veg_k_kadmium" bool DEFAULT false,
   "veg_k_krom" bool DEFAULT false,
   "veg_k_metilb" bool DEFAULT false,
   "veg_k_metilk" bool DEFAULT false,
   "veg_k_kriolit" bool DEFAULT false,
   "veg_k_nikkel" bool DEFAULT false,
   "veg_k_nitrogen" bool DEFAULT false,
   "veg_k_olom" bool DEFAULT false,
   "veg_k_szelen" bool DEFAULT false,
   "veg_k_szenken" bool DEFAULT false,
   "veg_k_szentet" bool DEFAULT false,
   "veg_k_sztirol" bool DEFAULT false,
   "veg_k_tetrak" bool DEFAULT false,
   "veg_k_toluol" bool DEFAULT false,
   "veg_k_triklor" bool DEFAULT false,
   "veg_k_trotyl" bool DEFAULT false,
   "veg_k_vanadium" bool DEFAULT false,
   "veg_k_vinilk" bool DEFAULT false,
   "veg_k_noveny" bool DEFAULT false,
   "ertekeles" text,
   "jeloles" bool DEFAULT false,
   "c_userid" varchar(20),
   "c_date" date,
   "c_time" varchar(10),
   "m_userid" varchar(20),
   "m_date" date,
   "m_time" varchar(10),
    CONSTRAINT "kockazat_felmero_pk1" PRIMARY KEY ("kockazat_felmero_kod"),
   CONSTRAINT kockazat_felmero_fk1 FOREIGN KEY ("kockazat_felmero_pkod", "kockazat_felmero_tkod") 
      REFERENCES telephely ("telephely_pkod", "telephely_kod") MATCH SIMPLE  ON UPDATE NO ACTION ON DELETE NO ACTION
) WITHOUT OIDS;

ALTER TABLE kockazat_felmero OWNER TO mbt;

CREATE INDEX kockazat_felmero_id1 ON kockazat_felmero (kockazat_felmero_pkod, kockazat_felmero_tkod);  