Re: Having issues inserting a string with a ' into a varchar column - Mailing list pgsql-admin

From David G. Johnston
Subject Re: Having issues inserting a string with a ' into a varchar column
Date
Msg-id CAKFQuwbzdZ38iZXN9Mp3PEt767b9h-C91evBtAWo8GD_oqatMw@mail.gmail.com
Whole thread Raw
In response to Having issues inserting a string with a ' into a varchar column  (Sbob <sbob@quadratum-braccas.com>)
List pgsql-admin
On Friday, April 15, 2022, Sbob <sbob@quadratum-braccas.com> wrote:

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:


You have the right idea you need to escape it.  But guessing isn’t a good method to figure out how.


You can’t use quote_* on a literal if you do not express the literal correctly.

David J.
 

pgsql-admin by date:

Previous
From: Sbob
Date:
Subject: Re: Having issues inserting a string with a ' into a varchar column
Next
From: Kenny Bachman
Date:
Subject: postgresql-14 slow query