Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WN6F8-00015z-G0 for pgsql-bugs@arkaria.postgresql.org; Mon, 10 Mar 2014 19:52:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WN6F7-0000dv-UQ for pgsql-bugs@arkaria.postgresql.org; Mon, 10 Mar 2014 19:52:09 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WN6F6-0000bv-Pt for pgsql-bugs@postgresql.org; Mon, 10 Mar 2014 19:52:09 +0000 Received: from mail-lb0-f176.google.com ([209.85.217.176]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WN6F3-0006a2-SR for pgsql-bugs@postgresql.org; Mon, 10 Mar 2014 19:52:07 +0000 Received: by mail-lb0-f176.google.com with SMTP id 10so4878480lbg.7 for ; Mon, 10 Mar 2014 12:52:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=YeaDHV5jcFjz4j0UdZxYNbO3bSx0TxH9XOZCskZ0ELc=; b=Xbw3UJKU17r+DpNhzC7YnNsnGDDJ376dSRnNZXPA9NWt4jsgBg+Zhvx3xdGxidi4vn Hl0Wx4vInV98gmu5A/XhEN8G5c/aUNa800uHhkqEUxMR2fEUj1aiKXDD2jTTZk38wRvM SeBwK7RERInVpsnxs7ro9rvnbu4xDk+8qaXARGdFkG8cKuSiGrCrdjUFa/QVXBGAG77N UctzIZoWt8Wj8oj/m3yEZJsx1OURIAX8cshenN3RJrVXXStTJRGyjoEPilFRRF1H9E1V /mhZXk4j4N7IzHpf0mRS5t+/Y5/sdj3JeiK+a0Bq7oMQp/CvwYdCzRdtWdcSFOXnQs46 A/7w== X-Gm-Message-State: ALoCoQmLY/P4zkp0ISiJQ4+IyqAfx6g9H7MQvYY19BKwFCuqKXQwH3h3v/Km+BOGIzIKN1jkNp80 X-Received: by 10.112.166.37 with SMTP id zd5mr2153lbb.90.1394481124234; Mon, 10 Mar 2014 12:52:04 -0700 (PDT) Received: from dalli.local (c-77a4e355.026-50-73746f15.cust.bredbandsbolaget.se. [85.227.164.119]) by mx.google.com with ESMTPSA id q8sm22642474lbr.3.2014.03.10.12.52.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 10 Mar 2014 12:52:03 -0700 (PDT) Message-ID: <531E17E1.9020009@joh.to> Date: Mon, 10 Mar 2014 20:52:01 +0100 From: Marko Tiikkaja User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: alf.kristian@gmail.com, pgsql-bugs@postgresql.org Subject: Re: BUG #9519: Allows storing scalar json, but fails when querying References: <20140310150952.398.53642@wrigleys.postgresql.org> In-Reply-To: <20140310150952.398.53642@wrigleys.postgresql.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 3/10/14, 4:09 PM, alf.kristian@gmail.com wrote: > I think the insert should fail, since '1' is not valid JSON. It's a valid "JSON value", it's just not an object. If you only want to store JSON objects in the table, consider using a CHECK constraint. Regards, Marko Tiikkaja -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs