Re: Postgresql crash (signal 11). keywords: distinct, subselect, union - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Postgresql crash (signal 11). keywords: distinct, subselect, union
Date
Msg-id 28358.1139841725@sss.pgh.pa.us
Whole thread Raw
In response to Postgresql crash (signal 11). keywords: distinct, subselect, union  ("Magnus Naeslund(f)" <mag@fbab.net>)
Responses Re: Postgresql crash (signal 11). keywords: distinct, subselect,
List pgsql-hackers
"Magnus Naeslund(f)" <mag@fbab.net> writes:
> SELECT DISTINCT
>     *
> FROM
>     (
>     SELECT
>         vtgm.snicker_id
>     FROM snicker_group_mapping vtgm
>     WHERE exists
>         (
>         SELECT
>             *
>         FROM snicker_group vtg
>         WHERE vtgm.snicker_group_id = vtg.id
>             AND lower(vtg.title) ~* 'test'
>         )
>     UNION
>     SELECT
>         snicker.id
>     FROM snicker
>     WHERE lower(snicker.name_singular) ~* 'test'
>         OR lower(snicker.name_plural) ~* 'test'
>     ) AS vt_id
> WHERE vt_id is not null;

While the crash is certainly a bug, the answer is going to be "don't do
that".  Testing a whole record for null-ness is not meaningful.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: what's stored in pg_tblspc
Next
From: Andrew Dunstan
Date:
Subject: Re: Why don't we allow DNS names in pg_hba.conf?