[BUGS] performance for MIN,MAX aggregates

2003-03-11 Thread Ruslan A Dautkhanov
Hello all, Just a little simple example: isbs=# \d radauth Table "public.radauth" Column |Type | Modifiers --+-+--- dttm | timestamp(0) with time zone | user

Re: [BUGS] performance for MIN,MAX aggregates

2003-03-11 Thread Bruno Wolff III
On Tue, Mar 11, 2003 at 15:42:41 +0700, Ruslan A Dautkhanov <[EMAIL PROTECTED]> wrote: > Hello all, > > Just a little simple example: > > isbs=# \d radauth >Table "public.radauth" > Column |Type | Modifiers > --+

[BUGS] Aliased SubSelect in HAVING clause bug -- in progress?

2003-03-11 Thread Josh Berkus
Folks, I don't think I'm the first to report this, but: SELECT a.id, b.type, max(b.number), (SELECT count(*) from c where c.b_type = b.type) as count_c FROM a, b WHERE a.id = b.a_id GROUP BY a.id, b.type HAVING count_c > 2; Will get a: ERROR: Attribute "count_c" not found. It seems that

Re: [BUGS] Aliased SubSelect in HAVING clause bug -- in progress?

2003-03-11 Thread Tom Lane
Josh Berkus <[EMAIL PROTECTED]> writes: > SELECT a.id, b.type, max(b.number), > (SELECT count(*) from c where c.b_type = b.type) as count_c > FROM a, b > WHERE a.id = b.a_id > GROUP BY a.id, b.type > HAVING count_c > 2; > Will get a: > ERROR: Attribute "count_c" not found. As it should. > I