Re: incorrect query result using complex structures (views?)

From: Kovacs Zoltan <kovacsz(at)pc10(dot)radnoti-szeged(dot)sulinet(dot)hu>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: incorrect query result using complex structures (views?)
Date: 2001-05-08 17:30:19
Message-ID: Pine.LNX.4.21.0105081923240.13657-100000@pc10.radnoti-szeged.sulinet.hu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 8 May 2001, Tom Lane wrote:

> Kovacs Zoltan <kovacsz(at)pc10(dot)radnoti-szeged(dot)sulinet(dot)hu> writes:
> > I cannot decide if this is a serious bug or not --- some queries from
> > complex views may give strange results. The next few days I will try to
> > find the point where the problem is but now I can only include the data
> > structure and the SELECT statements which don't give the correct result.
>
> So ... um ... what do you consider incorrect about the results?
>
> regards, tom lane

The SELECTs give something like this:

tir=> select az, (select cikk from szallitolevel_tetele_ervenyes where
cikk = c.az) from cikk c limit 20;
az|?column?
------+--------
100191|
100202|
100203|
100006|
100016|
100027|
100028|
100039|
100080|
100099|
100100|
100102|
100105|
100106|
100107|
100108|
100109|
100110|
100111|
100112|
(20 rows)

But cikk.az and szallitolevel_tetele_ervenyes.cikk should be the same, so
the correct output for this query would be like this:

tir=> select c.az, cikk from cikk c, szallitolevel_tetele_ervenyes s where
c.az=s.cikk limit 20;
az| cikk
------+------
100743|100743
100742|100742
101080|101080
101075|101075
101084|101084
100124|100124
100467|100467
101080|101080
101163|101163
100517|100517
101080|101080
101163|101163
100719|100719
100406|100406
101080|101080
100286|100286
100367|100367
100406|100406
101080|101080
100546|100546
(20 rows)

Thanks in advance. Zoltan

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Barry Lind 2001-05-08 17:35:42 Re: AW: Isn't pg_statistic a security hole?
Previous Message Peter Eisentraut 2001-05-08 16:57:06 Re: Where `gcc -MMD' puts .d files