Insert line break in postgresql when updating text field

前端 未结 4 2002
小鲜肉
小鲜肉 2020-12-29 18:13

I am trying to update a text field in a table of my postgresql database.

UPDATE public.table SET long_text = \'First Line\' + CHAR(10) + \'Second line.\' WHE         


        
4条回答
  •  一整个雨季
    2020-12-29 18:45

    In my version of postgres, \n didnt work for line break and i used \r\n instead, like this:

    UPDATE public.table 
    SET long_text = E'First Liner\r\nSecond line.'
    WHERE id = 19;
    

提交回复
热议问题