Paul Lambert wrote:
I've got a function defined in PL/PgSQL to update some fields in a
record where the criteria for pulling out some other values from a table
is dynamic.
I define a string called account_criteria to which I assign a normal SQL
WHERE clause based on some work done earlier in
I've got a function defined in PL/PgSQL to update some fields in a
record where the criteria for pulling out some other values from a table
is dynamic.
I define a string called account_criteria to which I assign a normal SQL
WHERE clause based on some work done earlier in the function. I then
Andreas Kretschmer wrote on 28.10.2007 13:32:
But it seems my problem was actually caused by something else:
SELECT regexp_replace(myfield, '\s*', '', 'g')
FROM mytable;
you should escape the \, change to ...'\\s*'...
Ah! Didn't think this was necessary, as \t or \n did not need to be escaped
Thomas Kellerer <[EMAIL PROTECTED]> schrieb:
> Andreas Kretschmer wrote on 28.10.2007 12:42:
> >>I have a column with the datatype "text" that may contain leading
> >>whitespace (tabs, spaces newlines, ...) and I would like to remove them
> >>all (ideally leading and trailing).
> >You can use tr
Andreas Kretschmer wrote on 28.10.2007 12:42:
I have a column with the datatype "text" that may contain leading
whitespace (tabs, spaces newlines, ...) and I would like to remove them all
(ideally leading and trailing).
You can use trim() for that:
select 'x' || trim(both '\t' from trim(both
Thomas Kellerer <[EMAIL PROTECTED]> schrieb:
> Hi,
>
> I have a column with the datatype "text" that may contain leading
> whitespace (tabs, spaces newlines, ...) and I would like to remove them all
> (ideally leading and trailing).
You can use trim() for that:
select 'x' || trim(both '\t' fr
Hi,
I have a column with the datatype "text" that may contain leading whitespace
(tabs, spaces newlines, ...) and I would like to remove them all (ideally
leading and trailing).
I tried
SELECT regexp_replace(myfield, '\A\s*', '')
FROM mytable;
(for leading whitespace, to start with)
But it