jsonb Questions

3

I have a native postgresql query (opts - jsonb array): select * from table users jsonb_exists_any(opts, ARRAY['CASH', 'CARD']); it works fine in my database console and I'm getting a result: user1...
Rainbow asked 16/5, 2021 at 23:51

4

Solved

Postgres defines additional jsonb Operators such as ?|. However, using Spring JpaRepository query builder, interrogation character is always considered as a parameter, and I can't figure how to es...
Chimkent asked 22/5, 2018 at 9:53

3

Solved

I work on postgres database where I'll using a mix of relational tables and jsonb tables (which can be indexed). I have being using a lot of CTE queries to insert or update data selecting from a t...
Zippora asked 28/5, 2015 at 19:25

3

Solved

I Have a data like this - So i need to find out all rows with id=203498. How can i write a query for this ? Any Help ?
Pargeting asked 30/8, 2021 at 7:26

3

Solved

I have a jsonb column which has data as below. [ {"key": "unit_type", "value": "Tablet", "display_name": "Unit Type"}, {"key": "pack_type", "value": "Packet", "display_name": "Pack Type"}, {"ke...
Monstrance asked 25/10, 2015 at 14:34

6

Solved

I'm working on a migration software that will consume unknown data from REST services. I already think about use MongoDB but I decide to not use it and use PostgreSQL. After read this I'm trying ...
Carafe asked 11/7, 2018 at 3:13

3

How can I update timestamp in jsonb to value of function now()? I tried to do smt like this UPDATE test SET column = jsonb_set(column,'{time}',to_char(now(),'some date format'),true) I got er...
Eudora asked 24/5, 2018 at 4:50

1

Solved

Say I have a table 'testing' with a column 'agents' of type jsonb that stores an array of agent names > SELECT * FROM testing; +--------------------------------------+---------------------+ | id...
Epicene asked 17/1, 2024 at 13:43

5

Solved

I'm experimenting with postgres jsonb column types, and so far so good. One common query I'm using is like this: select count(*) from jsonbtest WHERE attributes @> '{"City":"Mesa"}'; How do...
Barbi asked 28/9, 2016 at 0:3

3

To persist I use Hibernate 6 and use on the entity: @JdbcTypeCode(SqlTypes.JSON) private String value; When you save to the database, save wrapped in quotes and inside the json escape the quotes: ...
Middendorf asked 18/8, 2022 at 17:30

4

This is my entity class that is mapped to a table in postgres (9.4) I am trying to store metadata as jsonb type in the database @Entity @Table(name = “room_categories”) @TypeDef(name = “jsonb”, ty...
Rhetic asked 19/12, 2018 at 9:13

3

Solved

Im currently trying to optimise data loading in Postgres via JDBC. We are using COPY FROM STDIN with FORMAT 'binary' Now building the binary byte arrays is pretty straight forward for strings, long...
Touzle asked 24/2, 2016 at 10:52

2

Solved

In the query below, $isComplete and $isValid are returned as a string. However, they are saved as boolean values. How can I get the boolean representation of these fields to be returned? query = ...
Lack asked 9/10, 2015 at 15:6

3

Solved

I have a table with jsonb field in table. CREATE TABLE data.items ( id serial NOT NULL, datab jsonb ) How to get size of this field in a query like this: select id, size(datab) from data.item...
Gin asked 5/11, 2016 at 16:17

3

Solved

After upgrading to PostgreSQL 9.4, how do I convert all my JSON columns into JSONB columns? I don't mind losing any duplicate keys and whitespace.
Vorfeld asked 21/1, 2015 at 19:40

3

I have DB table with a jsonb column that has an entity, with nested child entities. Let's say we have: SELECT jsonb_set('{"top": {"nested": {"leaf" : 1}}}', '{top,nested,leaf}', '2'); Which work'...
Exum asked 3/8, 2017 at 10:33

9

Solved

Looking to find all rows where a certain json column contains an empty object, {}. This is possible with JSON arrays, or if I am looking for a specific key in the object. But I just want to know if...
Andreasandree asked 18/6, 2014 at 18:23

11

Solved

Looking through the documentation for the Postgres 9.4 datatype JSONB, it is not immediately obvious to me how to do updates on JSONB columns. Documentation for JSONB types and functions: http://ww...
Krimmer asked 2/11, 2014 at 19:37

3

This is the JSONB array data type in the model and postgres database: . . . MyField: { type: DataTypes.ARRAY(DataTypes.JSONB), allowNull: false } . . . The table field contains JSONB values:...
Rijeka asked 21/7, 2019 at 12:10

7

Solved

With PostgreSQL(v9.5), the JSONB formats give awesome opportunities. But now I'm stuck with what seems like a relatively simple operation; compare two jsonb objects; see what is different or missi...
Birch asked 16/3, 2016 at 16:41

1

Solved

I'm trying to query a jsonb column in Postgres. I've created it from a nested java map, it isn't in array format, and can't work out if that is the thing that is causing me to have issues with my q...
Chinchin asked 13/7, 2023 at 6:7

2

Solved

I have a Product model with a jsonb field called dynamic. I have actually 2 product records Product 1 : dynamic = {"name": "super product 1", "description": "lorem ipsum text" } Product 2 : ...
Bateau asked 8/4, 2015 at 22:59

3

Solved

I'm trying to insert exiftool generated JSON into postgresql via psql which appears valid. It appears somehow that having the escaped single quote and the escaped double quote are not working prope...
Delacroix asked 28/2, 2016 at 0:22

5

Solved

I am working with Postgres 9.4. I have a JSONB field: Column │ Type │ Modifiers ─────────────────┼──────────────────────┼──────────────────────────────────────────────────────────────────── id │...
Beltran asked 1/2, 2016 at 11:18

5

Solved

$this->assertDatabaseHas() not working with JSON/JSONb columns. So how can I tests these types of columns in Laravel? Currently, I have a store action. How can I perform an assertion, that a ...
Archeology asked 6/5, 2018 at 18:16

© 2022 - 2025 — McMap. All rights reserved.