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 1j7Ny6-0007wx-Ow for pgsql-docs@arkaria.postgresql.org; Thu, 27 Feb 2020 18:33:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j7Ny4-000354-2F for pgsql-docs@arkaria.postgresql.org; Thu, 27 Feb 2020 18:33:04 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j7Ny3-00034x-Nb for pgsql-docs@lists.postgresql.org; Thu, 27 Feb 2020 18:33:03 +0000 Received: from mail-qv1-xf42.google.com ([2607:f8b0:4864:20::f42]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j7Ny0-000762-G5 for pgsql-docs@lists.postgresql.org; Thu, 27 Feb 2020 18:33:02 +0000 Received: by mail-qv1-xf42.google.com with SMTP id y8so51662qvk.6 for ; Thu, 27 Feb 2020 10:32:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=g3T5Kxg0zNC1oqF72e2rtqeQm+TLXDZ1qFqOYGt5vFE=; b=tNg72Qu7+QD5kO7Wn4hvRfrNdx0Xe5dc5qEinVI7XYFhpYjZH+jnX/7i8V756+SzlW M2PtHOmn2Pqd8Npin1Tj0zaTbykzkaNpNKn98dXTz/WojIbwzk0u/D7ZsuMDW8RqypmJ gP/RdTSfkOVYAAEEmVhYaE5RdDWMF0Vzr1ovAqDsLUowKvdnhlYhC3u+svkfnqMOhbHK sFIXvCFu2y3Am2SiDwWse0MbrlUzIGr+PXHYPHdYFDECjlonFY9cGeAiDwaVMEFkJTbi GlurDnm4D0Jcw9NiiiG7Gsk88Gb3wfNeO5bMu0SLz6gx14ThrKg6QKjQYIC1YgimuVIo 2pNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=g3T5Kxg0zNC1oqF72e2rtqeQm+TLXDZ1qFqOYGt5vFE=; b=Tm+26WPtZ6TbZQKlkK1y8Hj4P1nPDn5OQwR3hElNFlNaQf+uPs9h9aA2vNhG0Ktbeg s7pQJE8vXJm2VQe3S4KmBlL9IV4rTBkZ5aNYNDKOGK9ydqVXd9tskG1uhRJmNvdBuBEb v+BZv13haOtRLWrOEEq5y8aJ/Ml+IsPaYO5Prwf7Am9ngO6gezuPxEAajVpfXx+L6Mbp bPlaFTF+jD8+iMzbRzSneCMgGX9k8EPGG4gP9dfXtgRKoQC8Me1sxeLA/TGYuDlvvZm4 Ure+9ve8SdLJR1paXz9LPe3K11TKBbUAWyODnynVNB8rtPUKEqjQtIjgJOKW5kOuVrNr 8WVg== X-Gm-Message-State: APjAAAXMSGlHmrgrPwaHW+GQ1TdeOC83K3yj3zNKdimFu0RzJ7azQFjo NY4xvqwE49CUZbwyjW1IPiZ1cg== X-Google-Smtp-Source: APXvYqzFHzzRz4TNi+at4rcPYd1aO+tyPDrwfjk9+CjtkJ24CsCxxAgw7yJIdyNTETYX/Z7MIzyo8g== X-Received: by 2002:a0c:bf05:: with SMTP id m5mr243914qvi.26.1582828378604; Thu, 27 Feb 2020 10:32:58 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([179.56.30.174]) by smtp.gmail.com with ESMTPSA id u5sm3543730qkf.32.2020.02.27.10.32.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2020 10:32:58 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 2FB3A300651; Thu, 27 Feb 2020 15:32:56 -0300 (-03) Date: Thu, 27 Feb 2020 15:32:56 -0300 From: Alvaro Herrera To: "David G. Johnston" Cc: Tom Lane , Michael L Perry , pgsql-docs@lists.postgresql.org Subject: Re: 9.4. String Functions and Operators page does not document that encode adds line breaks Message-ID: <20200227183256.GA30538@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-Feb-09, David G. Johnston wrote: > Stating direct RFC4648 compliance would require us to drop the line breaks > that are only being added due to using MIME rules which ideally our general > encoding function would not do. Greenfield we probably would want base64 > to be general RFC4648 and add something like base64-mime which performs the > line breaking for the user per RFC 2045, base64-pem which would use that > specific environments RFC rules. Now, maybe we can add "base64-4648" or > "base64-general" while leaving "base64" alone and using the MIME version of > the rules? Patches welcome. I'm not sure that we *need* to preserve the historical behavior. Many people would probably be okay with encode('base64') returning no newlines (since they are useless most of the time anyway), and the minority that does can use encode('base64-rfc2045'). Another idea might be to add an optional 'flags' option to encode(), which are given to the encoder/decoder functions. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services