Received: from candle.pha.pa.us (maillist@s5-03.ppp.op.net [209.152.195.67]) by hub.org (8.9.2/8.9.1) with ESMTP id JAA37123 for ; Mon, 15 Mar 1999 09:26:26 -0500 (EST) (envelope-from maillist@candle.pha.pa.us) Received: (from maillist@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id JAA11984; Mon, 15 Mar 1999 09:26:20 -0500 (EST) From: Bruce Momjian Message-Id: <199903151426.JAA11984@candle.pha.pa.us> Subject: Re: [GENERAL] Error In-Reply-To: <199901142234.XAA07324@bohr.webline.dk> from Kaare Rasmussen at "Jan 14, 1999 11:33:59 pm" To: kar@webline.dk Date: Mon, 15 Mar 1999 09:26:20 -0500 (EST) Cc: pgsql-general@postgreSQL.org X-Mailer: ELM [version 2.4ME+ PL47 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit We have problems with aggregates in some views. It is a know problem on the TODO list. > I got an error when accessing a view. The view looks like this: > > CREATE TABLE ar_contacts( > contact_seq int, > update_date date, > period date, > paid float, > sales float, > last_date date, > due float, > PRIMARY KEY (contact_seq, period) > ); > CREATE VIEW ar_sales90_v AS > SELECT contact_seq, SUM(sales) AS sales90 FROM ar_contacts WHERE > period >= date(date_trunc('month','now'::date) - '2 month'::timespan) > GROUP BY contact_seq; > > If I > SELECT * FROM ar_sales90_v WHERE contact_seq = 1; > then everything is fine. I get what I expect: > > contact_seq|sales90 > -----------+------- > 1| 6 > (1 row) > > If I do this: > SELECT sales90 FROM ar_sales90_v WHERE contact_seq = 1; > I get this result: > > pqReadData() -- backend closed the channel unexpectedly. > This probably means the backend terminated abnormally before or while > processing the request. We have lost the connection to the backend, so > further processing is impossible. Terminating. > > The backend didn't die; I can restart psql and do my queries. > > > -- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026