Data dodania Pytanie
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
2017-06-29 21:06 Insert Array of JSONB with Sqlalchemy in postgresql »
I have an issue with inserting array of JSONB in postgresql. The issue is related to Issue with Sqlalchemy and inserting array of jsonb to postgresql ...
(0) odpowiedzi
2017-06-28 07:06 Full-text search on content of complex jsonb »
I have pretty complex jsonb column with nested arrays and objects. And I need to perform full-text search on it. Example of json: { "buyer": { "e...
(0) odpowiedzi
2017-06-24 09:06 How to fix keys in a jsonb field »
I have a table with one jsonb field. I want that field to have onlye three keys, say the table schema is name: string dob: date personal_data: jsonb ...
(1) odpowiedzi
2017-06-23 02:06 jsonb LIKE query on nested objects in an array »
My JSON data looks like this: [{ "id": 1, "payload": { "location": "NY", "details": [{ "name": "cafe", "cuisine":...
(2) odpowiedzi
2017-06-21 16:06 PostgreSQL - GROUP_CONCAT for JSONB column »
I try to find a way to concat JSONB values using Postgres. For example I have two lines : INSERT INTO "testConcat" ("id", "json_data", "groupID") V...
(2) odpowiedzi
2017-06-18 19:06 query for ids inside JSONB using jsonb_each and LATERAL in postgres »
Imagine a super simple table such as: create table object ( id INT, data jsonb ); With some data: INSERT INTO object (id, data) VALUES (...
(2) odpowiedzi
2017-06-17 13:06 postgres jsonb array index »
I have created a model in loopback with 3 properties connected to postgres. Among the properties defined, I have one array property. My model is defin...
(0) odpowiedzi
2017-06-16 19:06 Using Postgres jsonb type to store array of values vs collection of key/value pairs »
I have a jsonb type column named selection in a postgres database. I can store the document in it as { 'selection': ['foo', 'bar'] } or just ['foo'...
(1) odpowiedzi
2017-06-16 10:06 How to dynamically select variable data columns from variable tables when the columns and the tables are dependent on stored data? »
Using Django 1.10, Python 3.5, I have stored various information about the columns and tables I want to use to extract data in another table called s...
(0) odpowiedzi
2017-06-15 02:06 how to use temp data in where clause »
I have following temp table in sql, which i want to filter data from jsonb data. Usually, I use inner join to filter data with temp table. however, I...
(0) odpowiedzi
2017-06-14 14:06 Postgresql 9.4 - Invalid input syntax when converting to JSONB »
I've made a simple function to update a jsonb with new values: CREATE OR REPLACE FUNCTION jsonupdate( IN "pJson" jsonb, IN "pNewValues" jsonb) ...
(1) odpowiedzi
2017-06-13 23:06 How can I do less than, greater than in JSON Postgres fields? »
If I have some json: id = 1, json = {'key':95} id = 2, json = {'key':90} id = 3, json = {'key':50} Is there a way I can use Postgres fields to quer...
(2) odpowiedzi
2017-06-11 20:06 How can I append a given key to a PostgreSQL JSONB array? »
I have a JSONB store. requests: { "0000": ["1111"], "1111": ["2222"] } I can add into the store just fine when I have an initial value with: UP...
(1) odpowiedzi
2017-06-07 22:06 stringify/casting jsonb to string w/reliable whitespacing for hash in postgresql similar to JSON.stringify »
I'm looking to create a hashing function for jsonb fields, but need to control the casting to string to allow for client and server integrity. In othe...
(0) odpowiedzi