Re: remaining sql/json patches - Mailing list pgsql-hackers

From Shruthi Gowda
Subject Re: remaining sql/json patches
Date
Msg-id CAASxf_MW4RBUYuS3ybbJYH9U7LQ5cjT699naiG+xKX8g=7Ut2g@mail.gmail.com
Whole thread Raw
In response to Re: remaining sql/json patches  (jian he <jian.universality@gmail.com>)
Responses Re: remaining sql/json patches
List pgsql-hackers
Hi,
I was experimenting with the v42 patches, and I tried testing without providing the path explicitly. There is one difference between the two test cases that I have highlighted in blue.
The full_name column is empty in the second test case result.  Let me know if this is an issue or expected behaviour.

CASE 1:
-----------
SELECT * FROM JSON_TABLE(jsonb '{
         "id" : 901,
         "age" : 30,
         "full_name" : "KATE DANIEL"}',
                '$'
                COLUMNS(
                     FULL_NAME varchar(20),
                     ID int,
                     AGE  int           
      )                                                                                                          
   ) as t;

RESULT:
  full_name  | id  | age
-------------+-----+-----
 KATE DANIEL | 901 | 30

(1 row)

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;

RESULT:
 full_name | id  | age
-----------+-----+-----
           | 901 | 30
(1 row)


Thanks & Regards,
Shruthi K C

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Disconnect if socket cannot be put into non-blocking mode
Next
From: Alvaro Herrera
Date:
Subject: Re: remaining sql/json patches