Error

Поиск
Список
Период
Сортировка
От Kaare Rasmussen
Тема Error
Дата
Msg-id 199901142234.XAA07324@bohr.webline.dk
обсуждение исходный текст
Ответ на RE: [GENERAL] non-case sensitive searches  (Gregory Maxwell <greg@z.ml.org>)
Ответы Re: [GENERAL] Error  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список pgsql-general
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.


В списке pgsql-general по дате отправления:

Предыдущее
От: "Jackson, DeJuan"
Дата:
Сообщение: RE: [GENERAL] non-case sensitive searches
Следующее
От: Tim Williams
Дата:
Сообщение: Re: [GENERAL] Graphics Supported?