Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rjhfk-007HCu-DF for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Mar 2024 15:34:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rjhfi-00FPKg-OP for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Mar 2024 15:34:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rjhfi-00FPID-Cn for pgsql-hackers@lists.postgresql.org; Mon, 11 Mar 2024 15:34:38 +0000 Received: from fhigh8-smtp.messagingengine.com ([103.168.172.159]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rjhff-003x1t-QH for pgsql-hackers@postgresql.org; Mon, 11 Mar 2024 15:34:38 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 13C9511400D3; Mon, 11 Mar 2024 11:34:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 11 Mar 2024 11:34:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1710171274; x= 1710257674; bh=IqKwk3mqNmygsEvSfdg8Oc8f6OgO3lDunPX6LrlHsUg=; b=E fjCTgWemrtwH4IVBF1TvossKAO68A6QJwOLv3NZLREq9Fivc5bzQB9xSDyEXPh49 f/ybntJg4xmoYmS7J0/GmMsUoAmsFGmFdUT1fLUGm85fkkjsiyynq3kCglVR1Lmp 9kogv6T5jF53+c8OE6BQICWZ8vSb9UwCJBM0jseaWsL6HXHNCKdROMnvKjGu4swC 3brDgua3FZAUxG01FJd/4Jc9ahA0ar+tYL046syWTNusHbQTtPD4uoBqDbsJFqiX EEvTLucF1khvywTWWuaV4/JUB/oCuWDe6yAQ0gMDmS0m4h2PtF/28X0BymGbulzl kFeldTbbhApbgAi7bOa5A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrjedugdejjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeejkeff gfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhh vghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 11 Mar 2024 11:34:33 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1710171271; bh=mO+oNduAMx/ulGfZ4wLVc22Z6KSEh3+CQdFRe/rccoM=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=NW0SzKh5Z4upNEU+kHSjIiMxdBAAyP3ydHzaQm9E+LF/oj1ARe3HMpjCPJRNcbk/V lKqTK6X5cPNcY5x6LfuqYZeGEEDMfzA+EqYHrGh+cJoNYhzCBwXc/Nwkq4qtpHuhX5 wihxWFykot1p3jxCTCbfZUUyMK3ySVKDMyux80wUGf01YAERQ4Qk2sSOVfe9WMJgS4 ylSLPJoGHMKfB0OOWkJrX9XguHSuytU8XNisonjL4jqujR/VMJxWZXPIkYq1Lc/UCH ygWhKRpzad6C03sSxp99qe9wyG2esCbToBWUfDLD8aKspWO/6OuIZPeEUJstybW/cG BTy8LlRMdNdZw== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 5BE09CD5; Mon, 11 Mar 2024 16:34:31 +0100 (CET) Date: Mon, 11 Mar 2024 16:34:31 +0100 From: Alvaro Herrera To: Shruthi Gowda Cc: jian he , Amit Langote , Andres Freund , Andrew Dunstan , Erik Rijkers , PostgreSQL-development , Tomas Vondra Subject: Re: remaining sql/json patches Message-ID: <202403111534.xii7yxswadef@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2024-Mar-11, Shruthi Gowda wrote: > *CASE 2:* > ------------------ > SELECT * FROM JSON_TABLE(jsonb '{ > "id" : 901, > "age" : 30, > "*FULL_NAME*" : "KATE DANIEL"}', > '$' > COLUMNS( > FULL_NAME varchar(20), > ID int, > AGE int > ) > ) as t; I think this is expected: when you use FULL_NAME as a SQL identifier, it is down-cased, so it no longer matches the uppercase identifier in the JSON data. You'd have to do it like this: SELECT * FROM JSON_TABLE(jsonb '{ "id" : 901, "age" : 30, "*FULL_NAME*" : "KATE DANIEL"}', '$' COLUMNS( "FULL_NAME" varchar(20), ID int, AGE int ) ) as t; so that the SQL identifier is not downcased. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/