0
votes

I'm trying to use JSONB data type in PostgreSQL for my product table, like the following example:

enter image description here

Then, when I execute the below INSERT query for this table, the query is not executed !

INSERT INTO PRODUCT 
VALUES 
(7, 'iPhone8', 'Grey', 700.00, 34, '{"storage": 256, "RAM": 16, "resolution": 1700X456 }')
1
Please do not post code as images. See here for more details why: meta.stackoverflow.com/questions/285551 - a_horse_with_no_name
What is the error you get? - a_horse_with_no_name

1 Answers

0
votes

You forgot double quotes in value "1700X456" (it is a string, not a number).

INSERT INTO PRODUCT 
VALUES 
(7, 'iPhone8', 'Grey', 700.00, 34, '{"storage": 256, "RAM": 16, "resolution": "1700X456" }')