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.89) (envelope-from ) id 1hOMKS-0007Ei-MO for pgsql-general@arkaria.postgresql.org; Wed, 08 May 2019 13:09:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hOMKR-0008Tu-BS for pgsql-general@arkaria.postgresql.org; Wed, 08 May 2019 13:09:47 +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 1hOMKQ-0008Sc-Sy for pgsql-general@lists.postgresql.org; Wed, 08 May 2019 13:09:47 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hOMKO-0006on-0R for pgsql-general@postgresql.org; Wed, 08 May 2019 13:09:46 +0000 Received: by mail-qt1-x843.google.com with SMTP id o7so972828qtp.4 for ; Wed, 08 May 2019 06:09:43 -0700 (PDT) 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=TzBgHrLoaXBwQpPRQxpxxVW3uE6TB5qQ7+qg1GVzNes=; b=bGf7TKLWhaYjssc0khMkMKigQF5WnlSzDr8F4YjhjYkjIajRqUh2E5Zi8eUvMa0ykT 15/ThkSJPuf61DO8yCEC8r8jkQL6KvtHyTTV/B9CNDz2SpQGhhtx/apopnY8/p4PyVo2 3Ebl3mMSlYPuGUPud4zfeYrDjRFdi6N3jH8zsgoWUZKYd+Qmw6E8YayRrnGuLW/UPKaJ ACUr4/1zQSMgpq+MLw5QquMvFoMFWLrC7PIRHh7rrxY8kr1m/fuN/OKooesf/mbKSisl 3QcSTSGwRU+6C9PpYur+kmkLhChJuugmIF6QT49HoN4f0QBf2UtJV5PVtyht5xnpx1hK jAJA== 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=TzBgHrLoaXBwQpPRQxpxxVW3uE6TB5qQ7+qg1GVzNes=; b=DIf6yzbtW+gUa93bjSg/qDu8e5JzPEHnJW6p4kEanO2tWqZYDekXsxn1abFi/3NMEv dZ4/vKsSUt5gJ8DZOJzW3lVes2S6DvMzD4jfj7JJpETGSqRqvyNZsdyphk+CedJ29+mW KPDJfUHSFuUQaF9IqWdSxzwZsjG3KvY2GH8dpwhBq1Nptg5mYZDsVjFkhMbYK5aCE1fU x4JwjUz1CLraUuJ6/4h/oMgn2qgIquSxHfO0JsjCGsRlmivG/4bN74MSzdmG4l8S+QQn ak0lsENq2oYrfDanlVgQMp9VykJq/deO3+Y1miDz7rkAYlBTobIgqbBuhbsIz3BftIzP 1MPQ== X-Gm-Message-State: APjAAAVqgpAVF5KDUT83cTsdQrFjWsQnGtSoqVvVojTHaOuUahkO9aW8 7nVmA9A2Ns8OHBWeN2E0SeRjOQ== X-Google-Smtp-Source: APXvYqyIamfrhATmXgH6ClSUwu79j+LbgNopuABPbjH4Qg0NPPdFfkYREjzglaUncF0EWnWqSDHn+Q== X-Received: by 2002:ac8:530b:: with SMTP id t11mr3510263qtn.28.1557320982263; Wed, 08 May 2019 06:09:42 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id r4sm8644683qkd.84.2019.05.08.06.09.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 May 2019 06:09:41 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 32A621239B4; Wed, 8 May 2019 09:09:37 -0400 (-04) Date: Wed, 8 May 2019 09:09:37 -0400 From: Alvaro Herrera To: Mitar Cc: Tom Lane , pgsql-general@postgresql.org Subject: Re: Relaxing NaN/Infinity restriction in JSON fields Message-ID: <20190508130937.GA6216@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.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-May-07, Mitar wrote: > On Mon, May 6, 2019 at 1:21 PM Tom Lane wrote: > > There is not, and never has been, any claim that JSON numbers correspond > > to the IEEE spec. > > There is note [1], but yes, it does not claim that nor I claimed that. > I am just saying that the reality is that most people these days use > IEEE spec floating numbers so it is sad that those cannot be easily > stored in JSON, or a database. If you want to complain about JSON, it's IETF that you need to talk about, not us -- we're just implementing their spec. As for storing the numbers in a database, you can already do that, just not on the JSON datatype. There is a lot of talk in the json mailing list about subnormals and why they don't want them valid in JSON because of interoperability, and that discussion led to the wording present in RFC7159; strangely, the wording there about Inf/NaN predates that discussion (it's already there in RFC4627) and I couldn't find the rationale for they being disallowed. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services