Re: Having issues inserting a string with a ' into a varchar column

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



correction, the quote_ident below should be quote_literal

I did not try quote_ident




On 4/15/22 12:01, Sbob wrote:

Hi all;


I have a table that includes a varchar column.

I am inserting some data and one of the strings = "Poker 5 card Hold'Em"

as a straight string it errors out.


I tried this :  quote_ident ( 'Poker 5 card Hold'Em')

but it still error's out


I also tried :  quote_literal('Poker 5 card Hold\'Em')

but it also errors out:


psql:test.sql:1042: ERROR:  syntax error at or near "Em"
LINE 1: ...ed) VALUES ( quote_literal('Poker 5 card Hold\\'Em'), 2, 1...


Thanks in advance




[Index of Archives]     [Postgresql Home]     [Postgresql General]     [Postgresql Performance]     [Postgresql PHP]     [Postgresql Jobs]     [PHP Users]     [PHP Databases]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Forum]

  Powered by Linux