| From: | Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us> | 
|---|---|
| To: | vadim(at)sable(dot)krasnoyarsk(dot)su (Vadim B(dot) Mikheev) | 
| Cc: | hackers(at)postgreSQL(dot)org | 
| Subject: | Re: [HACKERS] subquery syntax broken | 
| Date: | 1998-02-02 17:00:14 | 
| Message-ID: | 199802021700.MAA12855@candle.pha.pa.us | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-hackers | 
> vac=> select * from x where y = (select max(y) from x);
> ERROR:  parser: parse error at or near "select"
> vac=> select * from x where y <> (select max(y) from x);
> ERROR:  parser: parse error at or near "select"
Sorry I missed that most obvious option.  Here is the patch.  I will
apply it today.
---------------------------------------------------------------------------
*** ./backend/parser/gram.y.orig	Mon Feb  2 11:51:05 1998
--- ./backend/parser/gram.y	Mon Feb  2 11:59:12 1998
***************
*** 3330,3335 ****
--- 3330,3345 ----
  					n->subselect = $5;
  					$$ = (Node *)n;
  				}
+ 		| a_expr Op '(' SubSelect ')'
+ 				{
+ 					SubLink *n = makeNode(SubLink);
+ 					n->lefthand = lcons($1, NULL);
+ 					n->oper = lcons($2,NIL);
+ 					n->useor = false;
+ 					n->subLinkType = ALL_SUBLINK;
+ 					n->subselect = $4;
+ 					$$ = (Node *)n;
+ 				}
  		| a_expr AND a_expr
  				{	$$ = makeA_Expr(AND, NULL, $1, $3); }
  		| a_expr OR a_expr
-- 
Bruce Momjian
maillist(at)candle(dot)pha(dot)pa(dot)us
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bruce Momjian | 1998-02-02 17:05:17 | Re: [HACKERS] bug fix for select 'some Text'::char(16) (newest snapshot) | 
| Previous Message | The Hermit Hacker | 1998-02-02 16:59:54 | Re: [HACKERS] (: JDBC+(Sun ~3:pm MST) CVS :) -also question about regression tests |