title: Why do I get SQL state:23503 on an inexistent foreign key
body: <p>When I try to delete a record from table1 I receive this error message:</p>
  
  <pre class="lang-none prettyprint-override"><code>ERROR:  update or delete on "table1" violates foreign key constraint "&lt;unnamed&gt;" on "table2"
  DETAIL:  Key (idtb1)=(1569) is still referenced from table "table2".
  ********** Error **********
  
  ERROR: update or delete on "table1" violates foreign key constraint "&lt;unnamed&gt;" on "table2"
  SQL state: 23503
  Detail: Key (idtb1)=(1569) is still referenced from table "table2".
  </code></pre>
  
  <p>The problem is that I don't have any foreign key on table2.</p>
  
  <p>Here the scripts to create the tables</p>
  
  <pre><code>CREATE TABLE table1
  (
    idtb1 integer NOT NULL DEFAULT nextval('"table1_idtb1_seq"'::text),
    nometb1 character varying(16),
    stato character varying(4),
    capit character(1),
    email character varying(2000), 
    impianti boolean NOT NULL DEFAULT true 
  )
  WITH OIDS;
  ALTER TABLE table1
    OWNER TO postgres;
  
    CREATE TABLE table2
  (
    idtb2 integer NOT NULL DEFAULT nextval('"table2_idtb2_seq"'::text),
    idn integer DEFAULT 0,
    dataarr date,
    oraarr time without time zone,
    arrinc character varying(1),
    orind character varying(15),
    pprovenienza character varying(30),
    flgaggiunte character(1),
    ocm text,
    flageliminato character varying(1),
    nomea character varying(50),
    nomeb character varying(50),
    pesc double precision
  )
  WITH OIDS;
  ALTER TABLE table2
    OWNER TO postgres;
  </code></pre>
  
  <p>Is an old database</p>
  
  <p>"PostgreSQL 8.0.26 on x86_64-unknown-linux-gnu, compiled by GCC gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)"</p>
  
  <p>How can I proceed?</p>