Re: PG 7.0 crash on SELECT

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ldm(at)apartia(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PG 7.0 crash on SELECT
Date: 2000-06-04 18:57:06
Message-ID: 6467.960145026@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Louis-David Mitterrand <cunctator(at)apartia(dot)ch> writes:
> Issuing the followin SELECT crashes PG 7.0:
> auction=# SELECT a.id,a.title,a.id,(select CASE WHEN a.stopdate < 'now' THEN 'closed' ELSE 'open' end) as status,to_char(a.time,'DD-MM HH24:MI'),b.price FROM auction* a, bid b WHERE a.id = b.auctionid AND b.login = 'mito2';
> pqReadData() -- backend closed the channel unexpectedly.
> This probably means the backend terminated abnormally
> before or while processing the request.
> The connection to the server was lost. Attempting reset: Failed.
> !# \q

> Apparently PG doesn't like the (SELECT CASE ... ) statement, until I
> added it everything went well.

The crash certainly is a bug, but you could get around it for now
by not using an unnecessary sub-SELECT. Why not just
...,a.id,(CASE WHEN ...

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-06-04 19:14:21 Re: Variable formatting of datetime with DateStyle=ISO
Previous Message Tom Lane 2000-06-04 18:47:40 Re: AW: AW: Proposal for enhancements of privilege system