Re: [HACKERS] "internal error" triggered by EXISTS()

Vadim Mikheev <vadim@krs.ru>

From: Vadim Mikheev <vadim@krs.ru>
To: David Gould <dg@illustra.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers@hub.org
Date: 1998-07-15T02:41:09Z
Lists: 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