CREATE TABLE telephely
(
   "telephely_kod" serial NOT NULL, 
   "telephely_pkod" int4 NOT NULL, 
   "nev" varchar(80), 
   "isz" varchar(4), 
   "telepules" varchar(80), 
   "cim" varchar(80), 
   "telefon" varchar(15), 
   "fax" varchar(15), 
   "statusz" varchar(10), 
   "email" varchar(100),
   "kapcsolat" varchar(80),
   "orvos_nev" varchar(60), 
   "orvos_isz" varchar(4),
   "orvos_telepules" varchar(80),
   "orvos_cim" varchar(80),
   "orvos_pecsetszam" varchar(20),
   "ktj" varchar(15),
   "ellenorzes" bool,
   "feljegyzes" text,
   "teaor" varchar(4),
   "letszamkategoria" varchar(1),
   "datum_moktdat" date,
   "c_userid" varchar(20),
   "c_date" date,
   "c_time" varchar(10),
   "m_userid" varchar(20),
   "m_date" date,
   "m_time" varchar(10),   
   CONSTRAINT "telephely_pk1" PRIMARY KEY ("telephely_kod", "telephely_pkod"),
   CONSTRAINT telephely_fk1 FOREIGN KEY (telephely_pkod) REFERENCES partner (partner_kod) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION
) WITHOUT OIDS;
ALTER TABLE telephely OWNER TO mbt;

CREATE INDEX telephely_id1 ON telephely (telephely_pkod);