public inbox for [email protected]  
help / color / mirror / Atom feed
From: David G. Johnston <[email protected]>
To: Sbob <[email protected]>
Cc: Pgsql-admin <[email protected]>
Subject: Re: Having issues inserting a string with a ' into a varchar column
Date: Fri, 15 Apr 2022 11:16:31 -0700
Message-ID: <CAKFQuwbzdZ38iZXN9Mp3PEt767b9h-C91evBtAWo8GD_oqatMw@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

On Friday, April 15, 2022, Sbob <[email protected]> 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.

https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS

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

David J.


view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Having issues inserting a string with a ' into a varchar column
  In-Reply-To: <CAKFQuwbzdZ38iZXN9Mp3PEt767b9h-C91evBtAWo8GD_oqatMw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox