Re: [GENERAL] Trim not working (PostgreSQL 9.1.2 on Win64)

2012-07-28 Thread Edson Richter
Em 28/07/2012 19:41, Tom Lane escreveu: Edson Richter writes: If I do apply trim over the substring, no spaces are removed, and I cannot understand why. ... But using the regular expression matching "^\s*" and "\s*$" works, and spaces are removed: I think what this means is that what you say a

Re: [GENERAL] Trim not working (PostgreSQL 9.1.2 on Win64)

2012-07-28 Thread Edson Richter
Em 28/07/2012 20:18, Adrian Klaver escreveu: On 07/28/2012 03:20 PM, Edson Richter wrote: Em 28/07/2012 13:46, Adrian Klaver escreveu: On 07/27/2012 04:58 PM, Edson Richter wrote: I've a select with the following expression: select trim(both ' ' from substring(rslinha2 from 5 for position('(-

Re: [GENERAL] Trim not working (PostgreSQL 9.1.2 on Win64)

2012-07-28 Thread Adrian Klaver
On 07/28/2012 03:20 PM, Edson Richter wrote: Em 28/07/2012 13:46, Adrian Klaver escreveu: On 07/27/2012 04:58 PM, Edson Richter wrote: I've a select with the following expression: select trim(both ' ' from substring(rslinha2 from 5 for position('(-)' in rslinha2)-6)) from ... prob

Re: [GENERAL] Trim not working (PostgreSQL 9.1.2 on Win64)

2012-07-28 Thread Tom Lane
Edson Richter writes: > If I do apply trim over the substring, no spaces are removed, and I > cannot understand why. > ... > But using the regular expression matching "^\s*" and "\s*$" works, and > spaces are removed: I think what this means is that what you say are runs of spaces are no such t

Re: [GENERAL] Trim not working (PostgreSQL 9.1.2 on Win64)

2012-07-28 Thread Edson Richter
Em 28/07/2012 13:46, Adrian Klaver escreveu: On 07/27/2012 04:58 PM, Edson Richter wrote: I've a select with the following expression: select trim(both ' ' from substring(rslinha2 from 5 for position('(-)' in rslinha2)-6)) from ... problem is that the spaces are not being removed f

Re: [GENERAL] Trim not working (PostgreSQL 9.1.2 on Win64)

2012-07-28 Thread Adrian Klaver
On 07/27/2012 04:58 PM, Edson Richter wrote: I've a select with the following expression: select trim(both ' ' from substring(rslinha2 from 5 for position('(-)' in rslinha2)-6)) from ... problem is that the spaces are not being removed from either side. What would be wrong? FYI th

Re: [GENERAL] Trim not working (PostgreSQL 9.1.2 on Win64)

2012-07-27 Thread Edson Richter
Em 27/07/2012 21:04, Edson Richter escreveu: I've a select with the following expression: select trim(both ' ' from substring(rslinha2 from 5 for position('(-)' in rslinha2)-6)) from ... problem is that the spaces are not being removed from either side. What would be wrong? Than