Received: from mailhub2.liv.ac.uk (mailhub2.liv.ac.uk [138.253.100.95]) by hub.org (8.9.3/8.9.1) with ESMTP id JAA94360 for ; Tue, 27 Apr 1999 09:48:59 -0400 (EDT) (envelope-from m.pacey@liverpool.ac.uk) Received: from radar.rdues.liv.ac.uk ([138.253.50.35] helo=rdues.liv.ac.uk) by mailhub2.liv.ac.uk with smtp (Exim 1.92 #1) for pgsql-sql@postgresql.org id 10c8E8-0005pK-00; Tue, 27 Apr 1999 14:48:44 +0100 Received: from april.rdues.liv.ac.uk by rdues.liv.ac.uk (SMI-8.6/SMI-SVR4) id OAA22422; Tue, 27 Apr 1999 14:48:41 +0100 Received: from april by april.rdues.liv.ac.uk (SMI-8.6/client-1.4) id OAA14376; Tue, 27 Apr 1999 14:48:36 +0100 Sender: M.Pacey@liverpool.ac.uk Message-ID: <3725C034.7DFF@liverpool.ac.uk> Date: Tue, 27 Apr 1999 14:48:36 +0100 From: Mr M Pacey Organization: Research and Development Unit for English Studies X-Mailer: Mozilla 3.01GoldC (X11; I; SunOS 5.5.1 sun4u) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Arrays and count () Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I'm having difficulties formulating what I thought was a simple query in 6.3.2. I have a table defined like this: create table sentence ( typenum int4, wordpos int4, words text[], tags text[] ); What I'd like to do is, e.g. select all instances of tags[1] and display the frequency values for each unique (distinct) entry. The query I tried was: select sentence.tags[1], count (*) from sentence group by sentence.tags[1]; Which fails to parse. Trying to work backwards I try constructing a related command: select count (sentence.tags[1]) from sentence; And am treated to the error message: PQexec() -- Request was sent to backend, but backend closed the channel before responding. This probably means the backend terminated abnormally before or while processing the request. Is this a bug, or am I completely failing to understand one or more of the concepts involved here? Mike Pacey. P.S. Please cc any reply directly to me, as I'm not currently subbed to the list.