Re: [HACKERS] Phantom row from aggregate in self-join in 6.5 - Mailing list pgsql-hackers

From D'Arcy" "J.M." Cain
Subject Re: [HACKERS] Phantom row from aggregate in self-join in 6.5
Date
Msg-id m1180TM-0000bFC@druid.net
Whole thread Raw
In response to Re: [HACKERS] Phantom row from aggregate in self-join in 6.5  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Thus spake Tom Lane
> IIRC, you were the main advocate of the position that the code's
> existing behavior is correct.  Does that mean I can go change it? ;-)

I vote (again) for yes.  It's so annoying having to add code to test
each returned value against 0 just in case there is only one returned
value that needs to be checked.

"SELECT COUNT(*) FROM table" should always return one row but "SELECT
COUNT(*) FROM table GROUP BY somethng" returns a variable number of
rows anyway so what's the harm in extending "one or more" to "zero
or more" returned rows?  We have to iterate through whatever the
count is anyway in our programs.

-- 
D'Arcy J.M. Cain <darcy@{druid|vex}.net>   |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 424 2871     (DoD#0082)    (eNTP)   |  what's for dinner.


pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: inserts/updates problem under stressing !
Next
From: Philip Warner
Date:
Subject: Re: [HACKERS] RFC: Security and Impersonation