Received: from thor.tht.net (thor.tht.net [209.47.145.4]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eB806rP12744 for ; Thu, 7 Dec 2000 19:06:53 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by thor.tht.net (8.9.3/8.9.3) with ESMTP id TAA98118 for ; Thu, 7 Dec 2000 19:33:38 GMT (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id eB7NVtY28355; Thu, 7 Dec 2000 18:31:55 -0500 (EST) To: Beth Gatewood cc: Francis Solomon , pgsql-sql@postgresql.org Subject: Re: trying to pattern match to a value contained in a column In-reply-to: <3A3004DC.4FF7CB37@mbt.washington.edu> References: <3A3004DC.4FF7CB37@mbt.washington.edu> Comments: In-reply-to Beth Gatewood message dated "Thu, 07 Dec 2000 13:45:00 -0800" Date: Thu, 07 Dec 2000 18:31:54 -0500 Message-ID: <28352.976231914@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200012/54 X-Sequence-Number: 385 Beth Gatewood writes: > I hope this isn't because I am using 6.3 (yes...I know it is very very > old but this is currently where the data is!) > here is the query: > select * from av34s1 where chromat ~~ ('%' || sample || '%'); > ERROR: parser: syntax error at or near "||" I seem to recall that || (and most other operators) wasn't considered associative by the grammar way back when. Try a fully parenthesized expression: select * from av34s1 where chromat ~~ (('%' || sample) || '%'); regards, tom lane PS: And do think about updating soon, hmm?