Wrong query execution.

From: pginfo <pginfo(at)t1(dot)unisoftbg(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Wrong query execution.
Date: 2003-01-15 05:45:29
Message-ID: 3E24F579.FA14AE37@t1.unisoftbg.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

It is possible that I am wrong, but I can nof find my mistake.

I have this 2 querie:

delete from a_grad where ids NOT in ( select KL.IDS_GRAD from
a_klienti kl ) ;

It returns 0 rows are deleted !

And the second one:

delete from a_grad where ids IN (select G.IDS FROM A_GRAD G WHERE NOT
EXISTS ( select * from a_klienti kl where KL.IDS_GRAD = G.IDS) ) ;

It returns 356 rows are deleted !

I expected that the first will delete also 356 rows.

I am using pg 7.3.1 ( I got the same result on pg 7.3) running linux rh
7.3.

All IDS and IDS_GRAD are declared as name and do not exists any null's.
The encoding is unicode.

Pls. help me to resolve the situation.

Regards,
ivan.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Serhiy Levchenko 2003-01-15 07:44:08 sort by relevance
Previous Message Tom Lane 2003-01-15 05:01:39 Re: postgres on a PDA