CREATE TABLE tetel_rendeles
(
  partner_kod integer NOT NULL DEFAULT 0,
  tetel_kod integer NOT NULL DEFAULT 0,
  raktar_kod integer NOT NULL DEFAULT 0,
  rendelt numeric(16,2) DEFAULT 0,
  CONSTRAINT tetel_rendeles_pkey PRIMARY KEY (partner_kod, tetel_kod, raktar_kod),
  CONSTRAINT tetel_rendeles_fk1 FOREIGN KEY (tetel_kod)
      REFERENCES tetel (kod) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE CASCADE,
  CONSTRAINT tetel_rendeles_fk2 FOREIGN KEY (partner_kod)
      REFERENCES partner (kod) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE CASCADE,
  CONSTRAINT tetel_rendeles_fk3 FOREIGN KEY (raktar_kod)
      REFERENCES raktar_nevek (kod) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE CASCADE
)
WITHOUT OIDS;