Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nfQHg-0000Sa-0h for pgsql-admin@arkaria.postgresql.org; Fri, 15 Apr 2022 18:03:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nfQHe-00031D-TO for pgsql-admin@arkaria.postgresql.org; Fri, 15 Apr 2022 18:03:02 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nfQHe-0002yg-HP for pgsql-admin@lists.postgresql.org; Fri, 15 Apr 2022 18:03:02 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nfQHc-0008Iz-BO for pgsql-admin@lists.postgresql.org; Fri, 15 Apr 2022 18:03:01 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 23BE9320093A; Fri, 15 Apr 2022 14:02:59 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Fri, 15 Apr 2022 14:02:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= quadratum-braccas.com; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1650045778; x= 1650132178; bh=2R77biIPLp/qzdm4VRIHunut4e9Yq/uWPpZ4VEgAUsY=; b=x i8wILy5XVnG7P3pGsH2KAAoDYGbAxlrNeAxpPTfk83xIcEPOwXO3WreT7N0WoY70 sCr2FeMAyILTcISAfpOCPAIVNX8MfwyS8vdmNwnmylADXip7KYParCtgIqSn0tWn ZOXPn9vqXvg8xep25eZ6Dwe3qc2kjroR2D6TrWa+fJxedAkmrqRwG2/7qJlJI1+6 8Zrb1cqjzPASTlCUS/6aPJ7hsvUrBlnP/Ns458XS4DgO4QHmTWZylC4PnKiCCu7e AaC/F0wRXkcdz9byTZWF8T/1WGPnEbHpX+hheqoN5AJ7j/U9Kt6QWh1wVfiexdA7 Eb3qGPhK0yZPIT40JaJUA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1650045778; x= 1650132178; bh=2R77biIPLp/qzdm4VRIHunut4e9Yq/uWPpZ4VEgAUsY=; b=A 8jbtf8cd3RnNRR0qxmk7uZz0ofJESCMEmTIPJzCm/g4TZeu1ReV8spmXfjm0lWQs ooJkbgIp5eWUHuavaMiTEcdYOyQZGxmhsYcxtwdaVxZ4Zpj05osOkMI95TwHPXnz zT7GIh05ft8HOWefiKhujJY2nm5Ju1Er4kTzutDJ9McDLAA5lW1o2Z7hBY3EL0XD axMT/xfA/Jf866BVOCVIkmwYAd10WemRZIorWa/PyfQwp6rWTBBbcBttHaSM/Mcr a/YxgGHO76CLCmtrjMLwd460+FZS3EbrVay7eJr4uFqab0XNh6lCtsBTsQKm1Hck Vykv4JTarYFJfb76pirBg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudelhedguddvudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurheptgfkffggfgfuhffvfhgjsegrtd erredtfeejnecuhfhrohhmpefusghosgcuoehssghosgesqhhurggurhgrthhumhdqsghr rggttggrshdrtghomheqnecuggftrfgrthhtvghrnhepvdegjeffheevgedutdejhfeuff dvvdfhvdevjedvleeiteeiffevhfdtkefgffdvnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomhepshgsohgssehquhgrughrrghtuhhmqdgsrhgrtg gtrghsrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 15 Apr 2022 14:02:57 -0400 (EDT) Content-Type: multipart/alternative; boundary="------------34Ajv4EPV9w0BEgXtH19I4Fl" Message-ID: Date: Fri, 15 Apr 2022 12:02:57 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: Having issues inserting a string with a ' into a varchar column Content-Language: en-US From: Sbob To: Pgsql-admin References: <182146b5-7239-9fdb-1a17-2c16f306f76f@quadratum-braccas.com> In-Reply-To: <182146b5-7239-9fdb-1a17-2c16f306f76f@quadratum-braccas.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------34Ajv4EPV9w0BEgXtH19I4Fl Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 > > > --------------34Ajv4EPV9w0BEgXtH19I4Fl Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

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



--------------34Ajv4EPV9w0BEgXtH19I4Fl--