Re: r trim of characters other than space

From: "surabhi(dot)ahuja" <surabhi(dot)ahuja(at)iiitb(dot)ac(dot)in>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: r trim of characters other than space
Date: 2006-02-10 03:56:51
Message-ID: 967CFC4343BF2A4DAFACD026D33DC85118ECBD@jal.iiitb.ac.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

but how should i do it within a stored procedure
something like:

CREATE OR REPLACE FUNCTION insert(varchar(65),varchar(65),date,varchar(256)) RETURNS retval AS'
DECLARE
patName text;
BEGIN

patName := trim($1);
select trim(trailing `^` from patName) INTO patName;
trim(patName);

this seems to be giving syntax error

thanks,
regards
Surabhi

________________________________

From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Thu 2/9/2006 12:49 PM
To: surabhi.ahuja
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] r trim of characters other than space

***********************
Your mail has been scanned by iiitb VirusWall.
***********-***********

"surabhi.ahuja" <surabhi(dot)ahuja(at)iiitb(dot)ac(dot)in> writes:
> i want to make the following check,
> if it is having carets in the end, then those carets be removed.
> so if i get a string like abc def^^^^
> i should be able to get abc def

Per SQL spec:

regression=# select trim(trailing '^' from 'abc def^^^^');
rtrim
---------
abc def
(1 row)

regards, tom lane

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Luki Rustianto 2006-02-10 04:30:04 Re: Is there a way to limit CPU usage per user
Previous Message Stephen Frost 2006-02-10 02:51:13 Re: distinct not working in a multiple join