Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jHTOf-0005VX-3y for pgsql-docs@arkaria.postgresql.org; Thu, 26 Mar 2020 14:22:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jHTOc-0005Q2-RM for pgsql-docs@arkaria.postgresql.org; Thu, 26 Mar 2020 14:22:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jHTOc-0005Pv-GJ for pgsql-docs@lists.postgresql.org; Thu, 26 Mar 2020 14:22:10 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jHTOa-00037T-6i for pgsql-docs@lists.postgresql.org; Thu, 26 Mar 2020 14:22:09 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 02QEM6iQ011842; Thu, 26 Mar 2020 10:22:06 -0400 From: Tom Lane To: Brett Okken cc: pgsql-docs@lists.postgresql.org, Dave Cramer Subject: Re: char 0x00 In-reply-to: References: Comments: In-reply-to Brett Okken message dated "Thu, 26 Mar 2020 06:34:24 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11840.1585232526.1@sss.pgh.pa.us> Date: Thu, 26 Mar 2020 10:22:06 -0400 Message-ID: <11841.1585232526@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Brett Okken writes: > It might also be helpful to state in the opening paragraph about character > set support that the NUL character is not supported in any character set > (except SQL_ASCII). Uh, it's not supported *anywhere*, period. If you managed to get the server to accept a text string with an embedded NUL, I'd like to know how exactly, because that's a missed validation. As far as documentation goes, I'd be inclined to address the point in the page about string data types, https://www.postgresql.org/docs/current/datatype-character.html with text along the lines of "The contents of a string value must be validly encoded according to the database's encoding, and cannot include the character with code zero". I'd sort of thought we said that there already, but I don't see it. regards, tom lane