Re: [HACKERS] Phantom row from aggregate in self-join in 6.5

From: "D'Arcy" "J(dot)M(dot)" Cain <darcy(at)druid(dot)net>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us (Tom Lane)
Cc: lockhart(at)alumni(dot)caltech(dot)edu, mbeattie(at)sable(dot)ox(dot)ac(dot)uk, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] Phantom row from aggregate in self-join in 6.5
Date: 1999-07-24 12:00:12
Message-ID: m1180TM-0000bFC@druid.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at){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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Philip Warner 1999-07-24 12:40:27 Re: [HACKERS] RFC: Security and Impersonation
Previous Message D'Arcy J.M. Cain 1999-07-24 11:49:38 Re: [SQL] database design SQL prob.