Home > Software design >  how can i replace the 'S for a 's in postgresql?
how can i replace the 'S for a 's in postgresql?

Time:01-14

I have a table with large amount of 'S wrongly added and i want to replace it for 's:

I have tried with replace(field, ''S', ''s') but obviously doesn't accept it for the ', I also tired with the $$'$$ but still doesn't work.

The current version of PostgreSQL is 11 I have look into different threads and tried the solution there but didn't recognize i.e.

Replace apostrophe in string

CodePudding user response:

The quote is the escape character for quotes as well. So you need one more quote for each string: replace(field, '''S', '''s')

  •  Tags:  
  • Related