Data dodania Pytanie
2017-08-09 10:08 recursively flatten a nested jsonb in postgres without unknown depth and unknown key fields »
How can I recursively flatten a nested jsonb in postgres which I don't know the depth and the field at each depth? (see example below) A postgressql ...
(1) odpowiedzi
2017-08-09 10:08 Rails - Use jsonb instead of associations. How to integrate it in nested forms? »
Say there's a users table with column 'other_details' as jsonb datatype. There are different types of users. other_details contain many details which ...
(0) odpowiedzi
2017-08-08 22:08 Using dynamic schema with postgres »
I have to decide how I want to implement dynamic schema. I will try to put some more description where my problem is. I use the postgres DB in lates...
(0) odpowiedzi
2017-08-08 10:08 How to select data from jsonb column? »
I have got one column with type jsonb. The data in this column looks as below { "random_number1": { "random_number2": { ...
(1) odpowiedzi
2017-08-05 00:08 Query for exact match of jsonb column in Rails 5 and PostgreSQL »
In my Rails 5 app with a Postgres database, I have a model Post with jsonb column called comments. The default value for comments is {}. I would lik...
(1) odpowiedzi
2017-08-04 20:08 Access a JSONB array of objects as an object of arrays »
I have a JSONB column in my Postgres 9.6 database with roughly the following structure [ { "A": "some value", "B": "another value", "fo...
(1) odpowiedzi
2017-08-03 12:08 Postgres jsonb_set multiple nested fields »
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) odpowiedzi
2017-08-02 14:08 Postgres Multiple Joins »
Not an expert on SQL but I managed to get this query working and delivering the results I need. The trick is to get it performing. The two tables in q...
(1) odpowiedzi
2017-07-31 21:07 Search for jsonb concatenated values specified by keys »
I have jsonb data as : id | data 1 | {"last": "smith", "first": "john", "title": "mr"} 2 | {"last": "smith jr", "first": "john", "title": "mr"} 3 ...
(1) odpowiedzi
2017-07-30 18:07 Difference between Postgres JSONB, HStore and wide-column database »
As I know, Postgres supports 2 datatypes named jsonb and hstore respectively. With those datatypes, programmers allow to have a dynamic schema databas...
(0) odpowiedzi
2017-07-28 19:07 Math calculating with two JSONB keys in Postgres? »
I have JSONB column with data like: {"plays": {"win": 90, "draw": 8, "lose": 2}} How I can calculate sum with win and draw keys? Something like: ...
(2) odpowiedzi
2017-07-27 20:07 Spring JPA Sorting and Paging with PostgreSQL JSONB »
I am using Spring JPA in order to manage my PostgreSQL data. This data makes heavy use of the jsonb data type in PostgreSQL 9.4. My table (called job...
(0) odpowiedzi
2017-07-26 23:07 How do I query for empty jsonb arrays in Postgres, Activerecord, Rails 5 »
I have a Post model with the column defined by the following migration: add_column :posts, :comments, :jsonb, default: [] add_index :posts, :comment...
(1) odpowiedzi
2017-07-24 20:07 Sequelize update nested property in JSONB »
I am looking for a way to update only a nested key/value inside jsonb column. here is the User model: const User= sequelize.define('User', { id: ...
(1) odpowiedzi
2017-07-24 14:07 Getting JSON field key names in Postgres »
I have data which uses JSON as tagged unions, such that a top-level object contains just one child object. The type of the child object depends on it...
(1) odpowiedzi
2017-07-24 10:07 Rails5 / strong parameters / json columns with 'dynamic' keys »
Googling around, found a hell of a lot of potentials solutions to handle it correctly, ended up with the following, which work def item_params ...
(1) odpowiedzi
2017-07-21 17:07 How to make fields default to values assigned to a jsonb field? »
I have a table: CREATE TABLE inbound ( -- broadcasts received from RTs id SERIAL primary key, ts TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT no...
(2) odpowiedzi
2017-07-20 15:07 Looking for a value in a jsonb list of keys/values »
I have a postgresql table of cities (1 row = 1 city) with a jsonb colum containing the name of the city in different languages (as a list, not an arra...
(1) odpowiedzi
2017-07-18 17:07 Expand a jsonb array proprietie »
By selecting from a jsonb field in a pg3 database, i'm getting results like this one: res text ["card", "dog", "chair"] ["house", ] ...
(0) odpowiedzi
2017-07-17 11:07 How to filter a query based on a jsonb data? »
Not even sure if it's possible to do this kind of query in postgres. At least i'm stuck. I have two tables: a product recommendation list, containing ...
(1) odpowiedzi
2017-07-12 01:07 How to perform bulk tag update operations in Postgres? »
I have a table in my Postgres 9.6 database which has tags. I wish these tags to be stored in a single column rather than normalized into a separate ta...
(0) odpowiedzi
2017-07-11 16:07 Validation of objects inside array of jsonb objects with RubyOnRails »
How would you validate each object inside an array of object with Rails? I am building a user profile form in our Rails app. Inside user model, we ha...
(2) odpowiedzi
2017-07-11 10:07 Aggregate rows in a jsonb attribute »
I have this table. id, variant_id, zone_id, col1, col2, col3 ---------------------------- 1 1 1 a b c 2 1 2 ...
(0) odpowiedzi
2017-07-11 09:07 PostgreSQL index for jsonb @> search »
I have the following query: SELECT "survey_results".* FROM "survey_results" WHERE (raw @> '{"client":{"token":"test_token"}}'); EXPLAIN ANALYZE...
(1) odpowiedzi
2017-07-10 12:07 PostgreSQL extract keys from jsonb, exception "cannot call jsonb_object_keys on a scalar" »
I am trying to get my head around with jsonb in Postgres. There are quite a few issues here, What I wanted to do was something like: SELECT table.col...
(1) odpowiedzi
2017-07-09 21:07 Deep search within jsonb field PostgreSQL »
A sample of my data looks something like this: {"city": "NY", "skills": [ {"soft_skills": "Analysis"}, {"soft_skills": "Procrastination"}, {"soft_sk...
(2) odpowiedzi
2017-07-09 19:07 Building Activerecord / SQL query for jsonb value search »
Currently, for a recurring search with different parameters, I have this ActiveRecord query built: current_user.documents.order(:updated_at).reverse_...
(1) odpowiedzi
2017-07-09 18:07 How to remove element form postgres jsonb by key value? »
I have a jsonb column with this format. { "categoryList": [{ "category_menu_id": "51", "is_featured_product": 0 }, { ...
(1) odpowiedzi
2017-07-07 15:07 How to use `jsonb_set` on column with null values »
I am using Postgres 9.6 and I have a JSONB column in which some rows have NULL value and some have dict values like {"notify": false}. I want to upda...
(1) odpowiedzi
2017-07-07 04:07 Postgres jsonb support in spring data »
As Postgres offers nosql flavor along with rdbms by jsonb data type I was looking into springboot and spring data to see what opinionated frameworks s...
(0) odpowiedzi
2017-07-07 01:07 jsonb querying with sql alchemy »
I'm getting the following error No operator matches the given name and argument type(s). You might need to add explicit type casts. on this code de...
(0) odpowiedzi
2017-07-05 18:07 Postgresql - update delete value from a nested jsonb element »
Is there a way to delete/update a nested json key object (not array) for example the following json: { "top": { "nested": { "leaf": 1 ...
(1) odpowiedzi
2017-07-04 18:07 SQLAlchemy - querying and filtering nested jsonb field »
I need to construct the following sql query: SELECT distinct entity.id, item_keys FROM entity jsonb_each(entity.jsonb) item, -- extracts firs...
(1) odpowiedzi
2017-07-01 11:07 Postgresql jsonb column joins across two table first one is object and second one is array of objects »
I'm trying to do following thing,I lost some days working on this... I think following code snippets are enough in order to understand the issue, if n...
(0) odpowiedzi
2017-06-30 17:06 How do I efficiently calculate summary stats on JSONB arrays nested in Postgres? »
Using Postgres 9.6. I have this working but suspect there's a more efficient way. What's the best way to calculate AVG, SUM, etc. on the MyEventLengt...
(1) odpowiedzi