X-Original-To: pgsql-sql@postgresql.org Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 4DD32475A45 for ; Fri, 7 Mar 2003 12:08:15 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.8/8.12.8) with ESMTP id h27H8Jx6000959; Fri, 7 Mar 2003 12:08:19 -0500 (EST) To: Mark Mitchell Cc: pgsql-sql@postgresql.org Subject: Re: Underscores in column names In-reply-to: <1047052681.24305.6.camel@sql.icnfull.com> References: <1047052681.24305.6.camel@sql.icnfull.com> Comments: In-reply-to Mark Mitchell message dated "07 Mar 2003 10:58:00 -0500" Date: Fri, 07 Mar 2003 12:08:19 -0500 Message-ID: <958.1047056899@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200303/202 X-Sequence-Number: 12242 Mark Mitchell writes: > SELECT * FROM "NATAB" WHERE > "NATAB"."NA_LAST_NAME" LIKE 'MITCHELL%' AND > SUBSTRING("NATAB"."NA_NAME",0,"NATAB"."NA_COLON") LIKE 'MARK%' > Produces the error : "ESCAPE string must be empty or one character" This is a datatype issue, not a naming issue. If the second and third arguments to substring() aren't integers (and no, I don't mean numeric, nor float, I mean int4), the parser is likely to think you are asking for the three-text-parameter variant of substring(). Which is SQL99-style regexps with an alternate escape string. regards, tom lane