Re: [HACKERS] Counting bool flags in a complex query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Richards <miker(at)scifair(dot)acadiau(dot)ca>
Cc: sql(at)postgreSQL(dot)org, hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] Counting bool flags in a complex query
Date: 1999-07-15 15:07:10
Message-ID: 6419.932051230@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

Michael Richards <miker(at)scifair(dot)acadiau(dot)ca> writes:
> I'm not sure this is correct, but I think I see a bug of some sort...

> SELECT folderid,foldername,count(*),sum(contentlength),sum(case when
> flagnew = TRUE then 1 else 0 end) FROM usermail,folders WHERE
> usermail.loginid='michael' and folders.loginid=usermail.loginid AND
> usermail.folder = folders.folderid GROUP BY folderid,foldername UNION
> SELECT folderid,foldername,0,0,0 FROM folders WHERE loginid='michael' AND
> NOT EXISTS (SELECT folder FROM usermail WHERE loginid='michael' AND
> folder=folderid) ;
> ERROR: _finalize_primnode: can't handle node 723

I committed a fix last night; it will be in 6.5.1.

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-07-15 15:23:13 Re: [HACKERS] Updated TODO list
Previous Message Tom Lane 1999-07-15 14:58:23 Re: [HACKERS] MAX Query length

Browse pgsql-sql by date

  From Date Subject
Next Message Esteban Chiner Sanz 1999-07-15 17:14:09 Foreign keys
Previous Message Tom Lane 1999-07-15 00:27:06 Re: [SQL] How big can a transaction query be?