Re: [HACKERS] "internal error" triggered by EXISTS() - Mailing list pgsql-hackers

From Vadim Mikheev
Subject Re: [HACKERS] "internal error" triggered by EXISTS()
Date
Msg-id 35AC16C5.C0B9C32F@krs.ru
Whole thread Raw
In response to Re: [HACKERS] "internal error" triggered by EXISTS()  (dg@illustra.com (David Gould))
List pgsql-hackers
David Gould wrote:
>
> >
> > I tried the following to find out whether a table has any records
> > with field1 < X (for a constant X):
> >
> > tgl=> SELECT EXISTS(SELECT * FROM table WHERE field1 < X);
> > ERROR:  internal error: do not know how to transform targetlist
>
> Should have given a syntax error probably. But you might try:
>
> select 1 where exists (select...);
>
> Should be faster if and only if we are doing the existential query
> optimization trick (stop on the first qualifying row).

We do.

Vadim

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] "internal error" triggered by EXISTS()
Next
From: Vadim Mikheev
Date:
Subject: Re: [HACKERS] "internal error" triggered by EXISTS()