X-Original-To: pgsql-sql@postgresql.org Received: from lapcrew.com (pcp01360251pcs.benslm01.pa.comcast.net [68.81.104.121]) by postgresql.org (Postfix) with ESMTP id 09164475A45 for ; Fri, 7 Mar 2003 10:28:08 -0500 (EST) Received: from Spooler by lapcrew.com (Mercury/32 v3.31) ID MO0003F7; 6 Mar 03 10:23:27 -0600 Received: from spooler by lapcrew.com (Mercury/32 v3.31); 6 Mar 03 10:23:16 -0600 Received: from [194.54.43.44] (146.145.38.11) by Lapcrew Mail Server (Mercury/32 v3.31) with ESMTP ID MG0003F6; 6 Mar 03 10:23:07 -0600 Subject: Underscores in column names From: Mark Mitchell To: pgsql-sql@postgresql.org Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 (1.0.8-10) Date: 07 Mar 2003 10:58:00 -0500 Message-Id: <1047052681.24305.6.camel@sql.icnfull.com> Mime-Version: 1.0 X-Archive-Number: 200303/196 X-Sequence-Number: 12236 I have a underscores in most all of the column names in this database. I've ran into a problem where Postgres doesn't like them. 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" The column "NA_COLON" is a column that holds the numeric position at which the first name ends and the last name begins. If the column name does not contain an underscore it works fine. Any suggestions? - Mark