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 1nNGK2-0000EZ-Nj for pgsql-general@arkaria.postgresql.org; Thu, 24 Feb 2022 15:46:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nNGK0-000225-IY for pgsql-general@arkaria.postgresql.org; Thu, 24 Feb 2022 15:46:24 +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 1nNGK0-00021W-7y for pgsql-general@lists.postgresql.org; Thu, 24 Feb 2022 15:46:24 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nNGJt-00019T-L7 for pgsql-general@lists.postgresql.org; Thu, 24 Feb 2022 15:46:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 21OFkE001349228; Thu, 24 Feb 2022 10:46:16 -0500 From: Tom Lane To: =?UTF-8?Q?Johannes_Gra=c3=abn?= cc: pgsql-general@lists.postgresql.org Subject: Re: tsvector string representation and parsing In-reply-to: <54593f15-6b3b-086e-ce1e-69f0af9d38a9@selfnet.de> References: <9e1f312a-92cf-e002-9bfd-728aa450ee09@selfnet.de> <1259438.1645655411@sss.pgh.pa.us> <54593f15-6b3b-086e-ce1e-69f0af9d38a9@selfnet.de> Comments: In-reply-to =?UTF-8?Q?Johannes_Gra=c3=abn?= message dated "Thu, 24 Feb 2022 00:41:01 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1349226.1645717574.1@sss.pgh.pa.us> Date: Thu, 24 Feb 2022 10:46:14 -0500 Message-ID: <1349227.1645717574@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk =?UTF-8?Q?Johannes_Gra=c3=abn?= writes: > Before using format(), I tried just generating those strings by doubling > any single quote or backslash and enclosing the whole string in single > quotes, but that didn't seem a safe way, though it works in principle: That's the documented requirement, so I don't see why it wouldn't be safe. regards, tom lane