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 1jfCMu-00021s-AL for pgsql-docs@arkaria.postgresql.org; Sun, 31 May 2020 01:02:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jfCMq-00064O-L5 for pgsql-docs@arkaria.postgresql.org; Sun, 31 May 2020 01:02: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 1jfCMq-00064H-F1 for pgsql-docs@lists.postgresql.org; Sun, 31 May 2020 01:02: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 1jfCMj-0001EQ-TU for pgsql-docs@lists.postgresql.org; Sun, 31 May 2020 01:02:23 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 04V12Eqn025387; Sat, 30 May 2020 21:02:14 -0400 From: Tom Lane To: pelletier.michel@gmail.com cc: pgsql-docs@lists.postgresql.org Subject: Re: Minor result error in binary strings documentation In-reply-to: <159085906507.7029.6617929006199006685@wrigleys.postgresql.org> References: <159085906507.7029.6617929006199006685@wrigleys.postgresql.org> Comments: In-reply-to PG Doc comments form message dated "Sat, 30 May 2020 17:17:45 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15128.1590886934.1@sss.pgh.pa.us> Date: Sat, 30 May 2020 21:02:14 -0400 Message-ID: <15129.1590886934@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Doc comments form writes: > On the page: > https://www.postgresql.org/docs/12/functions-binarystring.html > The result for decode('123\000456', 'escape') is incorrect, it should be: > # select decode('123\000456', 'escape'); > decode > ------------------ > \x31323300343536 The example is "correct" as given, because it assumes bytea_output is set to escape, as noted at the top of the page. For v13, I have adjusted all the examples on this page to follow the modern default of bytea_output = hex, but I don't plan to retrofit the older branches that way. regards, tom lane