X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id B9373475D22 for ; Wed, 12 Feb 2003 21:05:47 -0500 (EST) Received: from wolff.to (wolff.to [66.93.249.74]) by postgresql.org (Postfix) with SMTP id C3CD1475D0F for ; Wed, 12 Feb 2003 21:05:41 -0500 (EST) Received: (qmail 2634 invoked by uid 500); 13 Feb 2003 02:19:07 -0000 Date: Wed, 12 Feb 2003 20:19:07 -0600 From: Bruno Wolff III To: Nicholas Allen Cc: Dmitry Tkach , pgsql-sql@postgresql.org Subject: Re: Possible bug in Postgres? Followup to "How do you select from a table until a condition is met?" Message-ID: <20030213021907.GA2561@wolff.to> Mail-Followup-To: Nicholas Allen , Dmitry Tkach , pgsql-sql@postgresql.org References: <200302121910.38232.nallen@freenet.co.uk> <200302122153.08970.nallen@freenet.co.uk> <3E4ACE74.109@openratings.com> <200302122321.18463.nallen@freenet.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200302122321.18463.nallen@freenet.co.uk> User-Agent: Mutt/1.3.25i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200302/272 X-Sequence-Number: 11670 On Wed, Feb 12, 2003 at 23:21:18 +0100, Nicholas Allen wrote: > However, if I try to count the records using the count(*) function I get the following error. > > ERROR: Attribute vu_tbl_user_all_s.s_surname must be GROUPed or used in an aggregate function > > Surely, if postgres can execute the query it should also be able to count the rows that would be returned in the query? Is this a bug in Postgres and is there a work around? I am using Postgres 7.3. If you are using count you probably don't want to be returning surnames, just the count.