I have something like this:
UPDATE table SET column=REGEXP_REPLACE(column, E'\[(.*)\]$', '');
Everything is ok with this query, but the problem exists when I want to do this from console, like here:
psql -U postgres db -c "UPDATE table SET column=REGEXP_REPLACE(column, E'\\[(.*)\\]$', '');"
I think there is a problem with escaping some characters, but I cannot handle it.