Data dodania Pytanie
2016-10-04 13:10 PostgreSQL create index in JSON array element »
I'm working with PostgreSQL 9.5, and I want to create an index for multiple fields of a JSON object. I'm showing two examples, the first one is workin...
(0) odpowiedzi
2016-10-03 19:10 Speed up insert of json into Postgresql »
Does it make sense to set the type of a column to text instead of jsonb when inserting a lot of records and change it back afterwards? I'm assuming Po...
(0) odpowiedzi
2016-10-03 17:10 Insert JSON string into Postgres and return field »
I want to insert a JSON string into a Postgres table with a jsonb field and want the insert query to return a part of the JSON. For example, I want to...
(1) odpowiedzi
2016-10-03 05:10 ActiveRecord constructs incorrect SQL when using JSONB/Hash with Array »
I am using jsonb datatype for a column named data. When I query using a simple hash, it works correctly: [1] pry(PredictionService)> Prediction.wh...
(1) odpowiedzi
2016-10-01 18:10 Storing array data in jsonb field with Rails and Postgresql »
Say I have a Car model in which I want to display different kinds of data. I add a data column to the table: class AddDataToCars < ActiveRecord::M...
(1) odpowiedzi
2016-09-29 20:09 Jooq custom binding registration in Java »
I have a custom binding written to convert from custom type to Postgres json type. This part of the documentation mentions how to register using xml ...
(1) odpowiedzi
2016-09-28 02:09 Postgres jsonb 'NOT contains' operator »
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 WHE...
(0) odpowiedzi
2016-09-27 20:09 How do I query a complex JSONB field in Django 1.9 »
I have a table item with a field called data of type JSONB. I would like to query all items that have text that equals 'Super'. I am trying to do thi...
(1) odpowiedzi
2016-09-27 13:09 Querying Postgres Table with JSONB data »
I have a Table which stores data in a JSONB column. Now, what i want to do is, query that table, and fetch records, which have specific values for a ...
(1) odpowiedzi
2016-09-26 21:09 Check if an object key appears twice in a json array of objects »
Given a jsonb array that looks like this: [ { "type": "foo", "desc": "example" }, { "type": "foo", "desc": "second example" }, { "type": "bar...
(2) odpowiedzi
2016-09-26 08:09 Postgres custom operator priority over built in? »
I recently wrote a blog post about creating a custom minus operator for PostgreSQL's JSONB type. Basically, an operator was created like this: CREA...
(1) odpowiedzi
2016-09-23 12:09 create partial index for postgresql jsonb field »
I am trying to add a partial index to postgresql jsonb column. The jsonb column is named: email_provider. I have tried adding a partial index on the c...
(1) odpowiedzi
2016-09-23 01:09 Sqlalchemy - how do I generate a query that returns only a field from a jsonb column »
I'm trying to find the best way to generate a sql query that gets me a specific field from a jsonb column from my db. I want to generate a query like ...
(0) odpowiedzi
2016-09-22 13:09 Difference between JSON and JSONB in Postgres »
What's difference between JSON and JSONB data type in PosgresSQL? When should be used specific one? What's benefits or disadvantages with respect t...
(2) odpowiedzi
2016-09-21 01:09 Join queries for jsonb fields »
Can anyone help me with a join query for tables with jsonb fields? If I have two tables and each has a jsonb column value and I need to run some join...
(1) odpowiedzi
2016-09-19 22:09 JSONB nulls and order by »
It seems that order by with nulls doesn't really work for jsonb? if I have many rows in a table that look like this: key | cae1f6e1-8c1b-4fec-900...
(2) odpowiedzi
2016-09-18 02:09 Postgres JSONB: query by negative numbers »
I am trying to query based on lat and lng values but the rows returned aren't matching my query when the value store is negative. However when i query...
(2) odpowiedzi
2016-09-15 15:09 Postgres: concatenate JSONB values across rows? »
I'm getting grips with the JSONB functionality in Postgres >= 9.5 (and loving it) but have hit a stumbling block. I've read about the ability to conca...
(2) odpowiedzi
2016-09-14 02:09 querying JSONB with array fields »
If I have a jsonb column called value with fields such as: {"id": "5e367554-bf4e-4057-8089-a3a43c9470c0", "tags": ["principal", "reversal", "interes...
(2) odpowiedzi
2016-09-14 02:09 Postgres jsonb array: query for non-empty intersection »
Suppose I have a JSONB column called value in a table t, and inside of these blobs of JSON is a tags field which is a list of strings. I'd like to ma...
(2) odpowiedzi
2016-09-07 12:09 Postgres jsonb get by dynamic path »
Is it possible to do something like this in Postgres: do $$ declare v_key text; v_json jsonb; begin v_key := 'id'; v_json := jsonb_build_obje...
(1) odpowiedzi
2016-09-06 11:09 jsonb query in AREL »
I'm fairly new to AREL, and have had trouble finding references to using Postgres JSONB with AREL. How might I convert this SQL into an AREL statemen...
(0) odpowiedzi
2016-09-01 21:09 Sum all of the items in a JSONB array field »
If my table is setup like: indicators: id: 56789, funding (JSONB): [ { amount: 345678 }, { amount: 7899 } ] I can...
(1) odpowiedzi
2016-09-01 20:09 cakephp condition using '?' in the string »
Is there any way to make a condition using '?', ex.: Model.field ? 'value'. I trying to make a query in a jsonb type column in postgresql, but it seem...
(0) odpowiedzi
2016-09-01 03:09 Postgres GROUP BY on jsonb inner field »
I am using Postgresql 9.4 and have a table test, with id::int and content::jsonb, as follows: id | content ----+----------------- 1 | {"a": ...
(1) odpowiedzi
2016-08-31 21:08 Accessing jsonb column and attributes from a Rails 5 Model »
I'm having a strange issue when I try to create a scope for one on my models that is accessing something in jsonb. The query looks fine by me but it s...
(1) odpowiedzi
2016-08-31 15:08 Inserting array containing json objects as rows in postgres 9.5 »
Just started using PostgreSQL 9.5 and have ran into my first problem with jsonb column. I have been trying to find an answer to this for a while but f...
(1) odpowiedzi
2016-08-30 22:08 Extract json array from postgres table gives error: cannot extract elements from a scalar »
By using jsonb_array_elements() function to extract out jsonb data array from Postgres, it gave error: cannot extract elements from a scalar I a...
(1) odpowiedzi
2016-08-30 13:08 push key value to jsonb field »
I added recently a jsonb field to one of my tables add_column :users, :preferences, :jsonb, null: false, default: '{}' and I am storing values like...
(1) odpowiedzi
2016-08-29 14:08 Update nested key with postgres json field in Rails »
I've been trying to update the following : {"boxes": {"book": 2, "moving": 2}, "goods": {}} to : {"boxes": {"book_new": 2, "moving": 2}, "goods": ...
(1) odpowiedzi
2016-08-23 12:08 Postgres order by price lowest to highest using jsonb array »
Say I have the following product schema which has common properties like title etc, as well as variants in an array. How would I go about ordering th...
(1) odpowiedzi
2016-08-21 22:08 Indexing of JSONB embedded Ecto2 models in Postgres 9.4+ »
I'm not clear on how to index embedded structs stored as JSONB with Ecto2/Postgres 9.4+ I have a schema with two embedded structs using embeds_one an...
(1) odpowiedzi
2016-08-19 16:08 postgres + jsonb + get values of key from multidimentional array »
I am trying to get jsonb result based on matching key. I have DB table "listings" with number and data column. number | data 1 | {"na...
(2) odpowiedzi
2016-08-18 22:08 Query Postgres JSONB where key doesn't exist »
Given a set of data. 1 | { 'completed': true } 2 | { 'office_completed': false } Is there a way to query office_completed != 'true' and have it ret...
(2) odpowiedzi
2016-08-18 07:08 Extract key, value from json objects in Postgres »
I have a Postgres table that has content similar to this: id | data 1 | {"a":"4", "b":"5"} 2 | {"a":"6", "b":"7"} 3 | {"a":"8", "b":"9"} Th...
(1) odpowiedzi