Re: [BUGS] BUG #8335: trim() un-document behaviour

2013-08-11 Thread Romain Billon-Grand
Finally could make it using regexp_replace (my_field_to_trim, '.+my_triming_string' , '') for the "leading" case regexp_replace (my_field_to_trim, 'my_triming_string(.+)' , '') for the "trailing" case And both of them in this order a for the "both" one. I don't know why, but  could not use '*?'

Re: [BUGS] BUG #8335: trim() un-document behaviour

2013-08-09 Thread Bruce Momjian
On Fri, Aug 9, 2013 at 11:06:15AM -0400, Tom Lane wrote: > Bruce Momjian writes: > > The attached patch swaps the arguments in the parser, and allows your > > expected behavior: > > This patch is completely unsafe. It will break stored rules, which may > contain calls using the existing argumen

Re: [BUGS] BUG #8335: trim() un-document behaviour

2013-08-09 Thread Tom Lane
Bruce Momjian writes: > The attached patch swaps the arguments in the parser, and allows your > expected behavior: This patch is completely unsafe. It will break stored rules, which may contain calls using the existing argument order (which will be dumped without any of the SQL-spec syntactic su

Re: [BUGS] BUG #8335: trim() un-document behaviour

2013-08-09 Thread Romain Billon-Grand
Running postgres 9.1.4 using pgAdmin3 on a macbook air intel OS 10.6 I just had this bug, using comma: SELECT trim(trailing texte_natif , 'DATEDENAISSANCE' ) FROM CROP returned the whole field, including the string 'DATEDENAISSANCE', but except the very first character, the column being called r

Re: [BUGS] BUG #8335: trim() un-document behaviour

2013-08-07 Thread Bruce Momjian
On Fri, Jul 26, 2013 at 02:23:10AM +, am...@amutu.com wrote: > in the postgresql doc 9.4,I find the trim() function like this: > > > trim([leading | trailing | both] [characters] from string) > > > so the trim should be pass only one argument with some optional prefix --- > but I > find th