| From: | "Magnus Naeslund(f)" <mag(at)fbab(dot)net> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: Postgresql crash (signal 11). keywords: distinct, subselect, |
| Date: | 2006-02-13 15:39:58 |
| Message-ID: | 43F0A84E.6030206@fbab.net |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Tom Lane wrote:
> "Magnus Naeslund(f)" <mag(at)fbab(dot)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.
>
Yep, my "workaround" (or bugfix) was to push that null test infront of
the exists. Also I might not need the surrounding distinct either,
doesn't union make the result distinct?
So if I would like to do the test after the union, I should add "AS xxx"
on both union queries and then "vt_id.xxx is not null", right ?
Regards,
Magnus
| From | Date | Subject | |
|---|---|---|---|
| Next Message | mark | 2006-02-13 15:40:31 | Re: Why don't we allow DNS names in pg_hba.conf? |
| Previous Message | Andrew Dunstan | 2006-02-13 15:30:39 | Re: Why don't we allow DNS names in pg_hba.conf? |