Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f9IIqnP14699 for ; Thu, 18 Oct 2001 14:52:49 -0400 (EDT) (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.4/8.11.4) with ESMTP id f9IIqkc25091; Thu, 18 Oct 2001 14:52:46 -0400 (EDT) To: Steve Frampton cc: pgsql-sql@postgresql.org Subject: Re: Doing a regexp-based search/replace? In-reply-to: References: Comments: In-reply-to Steve Frampton message dated "Thu, 18 Oct 2001 12:03:28 -0400" Date: Thu, 18 Oct 2001 14:52:46 -0400 Message-ID: <25088.1003431166@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200110/260 X-Sequence-Number: 5214 Steve Frampton writes: > If this were a text file, I would use a sed expression such as: > cat textfile | sed 's/-.*$//' > I've been looking for a way to do this with PostgreSQL but so far haven't > found a function that seems to be suitable. Write a function in pltcl or plperl, either of which can mash text strings with ease and abandon ... regards, tom lane