CREATE TABLE  karbantartas_jk
(
   "karbantartas_jk_kod" serial NOT NULL,
   "karbantartas_jk_pkod" int4 NOT NULL,
   "karbantartas_jk_tkod" int4 NOT NULL,
   "karbantartas_jk_gkod" int4 NOT NULL,
   "minta_nev" varchar(100),
   "gep_nev" varchar(60),
   "gep_gyartasiszam" varchar(40),
   "kelthely" varchar(60),
   "datum_keltido" date,
   "vegezte" varchar(50),
   "vbeosztas" varchar(40),
   "jovahagyta" varchar(50),
   "jbeosztas" varchar(40),
   "c_userid" varchar(20),
   "c_date" date,
   "c_time" varchar(10),
   "m_userid" varchar(20),
   "m_date" date,
   "m_time" varchar(10),  
  CONSTRAINT "karbantartas_jk_pk1" PRIMARY KEY ("karbantartas_jk_kod"),
     CONSTRAINT karbantartas_jk_fk1 FOREIGN KEY ("karbantartas_jk_pkod", "karbantartas_jk_tkod") REFERENCES telephely ("telephely_pkod", "telephely_kod") MATCH SIMPLE  ON UPDATE NO ACTION ON DELETE NO ACTION
) WITHOUT OIDS;

ALTER TABLE karbantartas_jk OWNER TO mbt;

CREATE INDEX karbantartas_jk_id1 ON karbantartas_jk (karbantartas_jk_pkod, karbantartas_jk_tkod); 