pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedPostres falls down on "having"
2+ messages / 2 participants
[nested] [flat]
* Postres falls down on "having"
@ 1999-08-10 05:35 Paul Mamin <pm@sky.ru>
0 siblings, 1 reply; 2+ messages in thread
From: Paul Mamin @ 1999-08-10 05:35 UTC (permalink / raw)
To: pgsql-sql
Please, help me. I have Postgres 6.5 on Linux and found some bug.
=====================================
Table definitions:
>create sequence serialseq;
>
>create table calls
>(numcall integer default nextval('serialseq') not null primary key,
>uzer integer not null,
>inter integer not null,
>calltime abstime not null,
>calldur reltime not null,
>inb integer not null,
>outb integer not null,
>callprice integer);
>
>create index uzer_udx
>on calls
>(uzer);
>
>create index inter_udx
>on calls
>(inter);
>
>create index calltime_udx
>on calls
>(calltime)
>create table pppdisab
>(uzer integer primary key,
>timedisab abstime,
>maxprice integer,
>maxdur integer,
>maxinb int8);
>
>create index timedisab_idx on pppdisab (timedisab)
=====================================
And then I make some query (time is european):
>select calls.uzer
> from calls,pppdisab
> where
> calltime>='01/08/1999'
> and calls.uzer=pppdisab.uzer
> and pppdisab.timedisab is NULL
> group by calls.uzer,maxprice,maxdur,maxinb
> having
> sum((int(calldur)+59)/60)>=maxdur
> or sum(callprice)>=maxprice
> or sum(int8(inb))>=maxinb
=====================================
And when result is not empty - everything's Ok.
But when it's empty then the main postmaster crashes with message to
stdout like this:
>pq_recvbuf: unexpected EOF on client connection
>pq_flush: send() failed: Broken pipe
>pq_recvbuf: recv() failed: Connection reset by peer
>pq_recvbuf: unexpected EOF on client connection
>NOTICE: Message from PostgreSQL backend:
> The Postmaster has informed me that some other backend died abnormally a
>nd possibly corrupted shared memory.
> I have rolled back the current transaction and am going to terminate you
>r database system connection and exit.
> Please reconnect to the database system and repeat your query.
>NOTICE: Message from PostgreSQL backend:
> The Postmaster has informed me that some other backend died abnormally a
>nd possibly corrupted shared memory.
> I have rolled back the current transaction and am going to terminate you
>r database system connection and exit.
> Please reconnect to the database system and repeat your query.
... and all backends fall down :(
=====================================
At the same time, when I make similar query, but without "having",
all works fine in any cases:
>select calls.uzer,sum((int(calldur)+59)/60),maxdur,sum(callprice),maxprice,sum(int8(inb)),maxinb
> from calls,pppdisab
> where
> calltime>='01/08/1999'
> and calls.uzer=pppdisab.uzer
> and pppdisab.timedisab is NULL
> group by calls.uzer,maxprice,maxdur,maxinb
=====================================
What's the matter?
Best regards,
Paul mailto:pm@sky.ru
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [SQL] Postres falls down on "having"
@ 1999-08-10 14:55 Tom Lane <tgl@sss.pgh.pa.us>
parent: Paul Mamin <pm@sky.ru>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 1999-08-10 14:55 UTC (permalink / raw)
To: Paul Mamin <pm@sky.ru>; +Cc: pgsql-sql
Paul Mamin <pm@sky.ru> writes:
> And when result is not empty - everything's Ok.
> But when it's empty then [ backend crashes ]
I can reproduce this bug with the current development sources.
Will look into it. A quick look at a backtrace suggests that
the problem is triggered by the "sum(int8(inb))>=maxinb" part
of the HAVING clause. You might be able to work around it if
you can use int4 or float instead of int8 ...
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~1999-08-10 14:55 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-08-10 05:35 Postres falls down on "having" Paul Mamin <pm@sky.ru>
1999-08-10 14:55 ` Tom Lane <tgl@sss.pgh.pa.us>
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