While below is ok:

select * from table_a a
    where (select data_a from table_a where id = a.id) >
          (select data_b from table_a where id = a.id);

but this fails:

select * from table_a a
    where ((select data_a from table_a where id = a.id) >
           (select data_b from table_a where id = a.id));

ERROR:  parser: parse error at or near ">"

Does anybody know why?
--
Tatsuo Ishii

Mon, 15 Jan 2001 22:04:24 +0900
Tatsuo Ishii <t-ishii@sra.co.jp>
subselect bug?
Tatsuo Ishii <t-ishii@sra.co.jp> writes:
> select * from table_a a
>     where ((select data_a from table_a where id = a.id) >
>            (select data_b from table_a where id = a.id));

> ERROR:  parser: parse error at or near ">"

Ugh.  The grammar does some pretty squirrely things with parentheses
around selects, and I guess it's getting confused on this.  Don't
know why offhand ...

			regards, tom lane

Mon, 15 Jan 2001 10:06:12 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: subselect bug? 
Tatsuo Ishii <t-ishii@sra.co.jp> writes:
> select * from table_a a
>     where ((select data_a from table_a where id = a.id) >
>            (select data_b from table_a where id = a.id));
> ERROR:  parser: parse error at or near ">"

I think I finally got this right ... see if you can break the revised
grammar I just committed ...

			regards, tom lane

Mon, 15 Jan 2001 15:38:19 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: subselect bug? 
> Tatsuo Ishii <t-ishii@sra.co.jp> writes:
> > select * from table_a a
> >     where ((select data_a from table_a where id = a.id) >
> >            (select data_b from table_a where id = a.id));
> > ERROR:  parser: parse error at or near ">"
> 
> I think I finally got this right ... see if you can break the revised
> grammar I just committed ...

Thanks. Works fine now.
--
Tatsuo Ishii

Tue, 16 Jan 2001 11:34:45 +0900
Tatsuo Ishii <t-ishii@sra.co.jp>
Re: subselect bug? 