Re: [SQL] Wierd stuff

Поиск
Список
Период
Сортировка
От wieck@debis.com (Jan Wieck)
Тема Re: [SQL] Wierd stuff
Дата
Msg-id m11tveG-0003kGC@orion.SAPserv.Hamburg.dsh.de
обсуждение исходный текст
Ответ на Re: [SQL] Wierd stuff  (Mario Jorge Nunes Filipe <mjnf@neptuno.sc.uevora.pt>)
Ответы Re: [SQL] Wierd stuff  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
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) #

В списке pgsql-sql по дате отправления:

Предыдущее
От: Mario Jorge Nunes Filipe
Дата:
Сообщение: Re: [SQL] Wierd stuff
Следующее
От: Mario Jorge Nunes Filipe
Дата:
Сообщение: Re: [SQL] Wierd stuff