Received: from orion.SAPserv.Hamburg.dsh.de (Tpolaris2.sapham.debis.de [53.2.131.8]) by hub.org (8.9.3/8.9.3) with SMTP id LAA75290 for ; Fri, 3 Dec 1999 11:41:46 -0500 (EST) (envelope-from wieck@debis.com) Received: by orion.SAPserv.Hamburg.dsh.de for pgsql-sql@postgreSQL.org id m11tveG-0003kGC; Fri, 3 Dec 99 17:33 MET Message-Id: From: wieck@debis.com (Jan Wieck) Subject: Re: [SQL] Wierd stuff To: mjnf@uevora.pt Date: Fri, 3 Dec 1999 17:33:32 +0100 (MET) Cc: pgsql-sql@postgreSQL.org Reply-To: wieck@debis.com (Jan Wieck) In-Reply-To: <3847F3ED.98D71567@neptuno.uevora.pt> from "Mario Jorge Nunes Filipe" at Dec 3, 99 04:46:37 pm X-Mailer: ELM [version 2.4 PL25] Content-Type: text Mario Filipe wrote: > > I'm developing a system with a large number of tables. > > > > One of the tables has (among others) the following fields: > > Table = aluno > > +----------------------------------+--------------------------------- > > | Field | Type > > +----------------------------------+--------------------------------- > > | numero_aluno | int4 > > | freguesia_naturalidade | int2 > > | concelho_naturalidade | int2 > > | nacionalidade | int2 > > > > another is like this: > > > > -- Table = concelho > > +----------------------------------+--------------------------------- > > | Field | Type > > +----------------------------------+--------------------------------- > > | codigo | int4 > > | nome | text > > > > The field "concelho_naturalidade" on the first table has values taken > > from the "codigo" field from the second. First of all, why aren't the two fields of the same data type? Shouldn't cause your problem, but it's bad database design anyway IMHO. > > Now comes the problem: > > [...] > > And now... even wierder (?): > [...] > > this is the expected output... the first one isn't. So does anyone have > a clue on what's going on? IIRC, corrupted indices can cause this type of misbehaviour. If you have any indices defined on the two tables, try to drop and recreate them. Jan -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #========================================= wieck@debis.com (Jan Wieck) #