pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kaare Rasmussen <kar@webline.dk>
To: pgsql-general@postgreSQL.org
Subject: Error
Date: Thu, 14 Jan 1999 23:33:59 +0100 (CET)
Message-ID: <199901142234.XAA07324@bohr.webline.dk> (raw)
In-Reply-To: <Pine.LNX.3.96.990114163410.13172A-100000@z.ml.org>

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.




view thread (40+ messages)  latest in thread

Message-ID: <199901142234.XAA07324@bohr.webline.dk>
Permalink:  ../199901142234.XAA07324@bohr.webline.dk/
Also on:    postgresql.org/message-id/199901142234.XAA07324@bohr.webline.dk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: kar@webline.dk
  Subject: Re: Error
  In-Reply-To: <199901142234.XAA07324@bohr.webline.dk>
  References: <Pine.LNX.3.96.990114163410.13172A-100000@z.ml.org> <199901142234.XAA07324@bohr.webline.dk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox