RE: [GENERAL] pqReadData() -- backend closed the channel unexpect edly.

From: "Jackson, DeJuan" <djackson(at)cpsgroup(dot)com>
To: Ludovico Magnocavallo <ludo(at)experian(dot)it>, pgsql-general(at)postgreSQL(dot)org
Cc: PGSQL SQL <pgsql-sql(at)postgreSQL(dot)org>
Subject: RE: [GENERAL] pqReadData() -- backend closed the channel unexpect edly.
Date: 1999-02-09 20:16:01
Message-ID: F10BB1FAF801D111829B0060971D839F65A349@cpsmail
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

> Thanks a lot for your suggestion, that in fact gets me
> through the loop.
> Only problem is, I need to group by origine and get that
> sum(bytes) and by
> destinazione and get that sum(bytes). They are different.
That's why I self join to the 'day' table and sum(o.bytes) and
sum(d.bytes), which should give you different results if origine and
destinazione aren't always the same on each row.

> Your statement
> only groups for origine (in fact it groups by address, which
> is non-existent
> in the day table, and gets me null values).
You are correct that should have been 'o.origine', sorry I was cut and
pasting your sql and missed that replace. But the query should work. if
you make that one change.
Corrected query:
INSERT INTO week (address, origbytes, destbytes, when)
SELECT o.origine, sum(o.bytes), sum(d.bytes), '09/02/1999 9:00:01'
FROM day o, day d
WHERE o.origine=d.destinazione AND
o.origine << '194.74.133.0/24' AND
o.when BETWEEN '09/02/1999 9:00:01' AND '09/02/1999 9:59:59' AND
d.when BETWEEN '09/02/1999 9:00:01' AND '09/02/1999 9:59:59'
GROUP BY o.origine, 4;

> In the meantime, I have discovered that the number of queries
> is irrelevant
> to the crash, the crash happens in the INSERT statement when
> the datetime
> field is set to 12:00:00 or 12:59:59 or whatever, but always at 12.
>
> Ludo
Rerun your loop and print out your date as you go until you get the
crash, and send it in. You might actually want to send in the perl-code
in question as well.
BTW. Your query will miss anything that happens on the hour.

-DEJ

Browse pgsql-general by date

  From Date Subject
Next Message Ludovico Magnocavallo 1999-02-09 21:55:47 Re: [GENERAL] pqReadData() -- backend closed the channel unexpect edly.
Previous Message The Hermit Hacker 1999-02-09 19:10:33 Re: [GENERAL] New Software Database is Live ...

Browse pgsql-sql by date

  From Date Subject
Next Message Ludovico Magnocavallo 1999-02-09 21:55:47 Re: [GENERAL] pqReadData() -- backend closed the channel unexpect edly.
Previous Message Ludovico Magnocavallo 1999-02-09 17:30:57 Re: [GENERAL] pqReadData() -- backend closed the channel unexpect edly.