Re: Select .... where id not in (....) returns 0 incorrectly

2022-04-04 Thread J. Roeleveld
On Monday, April 4, 2022 10:47:51 PM CEST David Rowley wrote: > On Tue, 5 Apr 2022 at 01:21, J. Roeleveld wrote: > > Personally, I think NULL should be treated as a seperate value and not > > lead to strange behaviour. > > I think the rationale behind IN and NOT IN ar

Re: Transaction and SQL errors

2022-04-04 Thread J. Roeleveld
On Monday, April 4, 2022 1:44:40 PM CEST David Rowley wrote: > On Mon, 4 Apr 2022 at 23:33, Sebastien Flaesch > > wrote: > > Any arguments I could give to programmers? Maybe: > > "You better replay all SQL of the whole transaction... (and make them as > > short as possible!)" ? > > There are S

Re: Select .... where id not in (....) returns 0 incorrectly

2022-04-04 Thread J. Roeleveld
On Monday, April 4, 2022 2:50:44 PM CEST Jeremy Smith wrote: > > Doesn't this usually happen if q.id contains NULL. That is as per ANSI > > standard. > > Yes, there's a good description of this here: > https://wiki.postgresql.org/wiki/Don't_Do_This#Don.27t_use_NOT_IN > > It would be better to us

Select .... where id not in (....) returns 0 incorrectly

2022-04-04 Thread J. Roeleveld
Hi all, While trying to write some queries to clean up records I no longer need, I come up with a very strange situation where numbers literally don't add up as expected. If anyone can help me trace where this strange behaviour is coming from and how to resolve it, please let me know. In case