Data dodania Pytanie
2017-02-09 11:02 "Big" data in a JSONB column »
I have a table with a metadata column (JSONB). Sometimes I run queries on this column. Example: select * from "a" where metadata->'b'->'c' is ...
(1) odpowiedzi
2017-02-09 10:02 Postgres function returning the number 0-7 round robin? »
How can I write a function which returns for example the numbers 0-7 round robin, in a "thread safe" manner ensuring a new number for each call (wrap ...
(1) odpowiedzi
2017-02-09 08:02 Postgresql query for objects in nested JSONB field »
I am using PostgreSQL 9.6, and I have a table named "ItemDbModel" with two columns looks like: No integer, Content jsonb Say I put many records li...
(1) odpowiedzi
2017-02-09 06:02 Composite Array Type as OUTPUT parameter in PostgreSQL »
I'm trying to insert data into composite array type in my function. It should accept data from composite array type of INPUT parameter and store data ...
(1) odpowiedzi
2017-02-08 22:02 Lazy order by/where evaluation »
Edit It seems that a pure materialization can be stored as a column on the table and indexed; however, my specific use case (semver.satisfies) requir...
(4) odpowiedzi
2017-02-08 22:02 ProgrammingError: cannot cast type double precision to time without time zone »
I have a django app with the following model: class Event(models.Model): # id = models.IntegerField(primary_key=True) event_type = models.For...
(2) odpowiedzi
2017-02-08 22:02 Multiple LIKE and AND operators in RAILS/POSTGRESQL »
I'm using Rails 5.0.1 and Postgresql as my database. I have a table with column :content which contains words. The problem: When I'm looking for a sp...
(3) odpowiedzi
2017-02-08 21:02 PostgreSQL - very slow fetch using an index »
I'm running postgresql 9.4 on Centos 6.7. One of the tables contains lots of millions of records, this is the DDL: CREATE TABLE domain.examples ( i...
(2) odpowiedzi
2017-02-08 18:02 Rails has and belongs to many duplicate entries »
I have 2 models and a join table('email_addresses_mailable_events'). Database being used is Postgres. class MailableEvent < ApplicationRecord ...
(0) odpowiedzi
2017-02-08 08:02 How to use volume in docker compose for postgres? »
Here is the image I am using. I named it posgres_test If I run the image individually docker run -i -t -v="test_volume:/var/lib/postgresql" -p 5432...
(3) odpowiedzi
2017-02-08 08:02 Targeting specific objects in jsonb array »
I need to select rows from table that match specific criteria which involves jsonb object field comparison. In the example below, I'd like to get onl...
(1) odpowiedzi
2017-02-08 01:02 Read disk .sql file names with PostgreSQL »
does anyone know how to read file name from the client machine disk from the postgresql manager? In sql used the following: EXECUTE master.dbo.xp_cm...
(0) odpowiedzi
2017-02-07 13:02 SQL - If Select returns nothing then do another Select »
I'm currently trying to do an SQL query that can detect if a SELECT query returns nothing, and then do another one if that is the case. Here is what ...
(2) odpowiedzi
2017-02-07 09:02 @NotNull on subclass getter affects parent class table »
I have a question related to javax.validation.constraints.NotNull annotation. In my project i do have classes tree like following : @Inheritance(stra...
(3) odpowiedzi
2017-02-07 08:02 How can I implement the excel's SMALL and LARGE functions in Postgres? »
LARGE lets you find the nth largest value in an array. SMALL lets you find the nth smallest value in an array. I want to do something like select SMA...
(1) odpowiedzi
2017-02-07 00:02 Why would updates to a paper_trail-enabled model fail silently? »
Rails 5.0.0, Heroku Postgres 9.6.1 m = MyModel.create(foo: 'bar') => #<MyModel foo: 'bar'> m.foo = nil => nil m.save => true m.reload ...
(0) odpowiedzi
2017-02-06 22:02 Why does my pg_query update method skips row? »
I'm just a beginner with php, even more so on PostgeSQL. I can say that my knowledge over php, json and sql is very limited. I have created an update...
(1) odpowiedzi
2017-02-06 14:02 Unable to fetch ID using Postgres Stored Function - Bad value for type int »
I am trying to get location information from the schema Location. Postgres version is 9.3.15 and maven jar used is 9.4-1200-jdbc4 ubuntu 14.04 LTS. F...
(1) odpowiedzi
2017-02-06 07:02 Why does PostgreSQL complain about type when I use CASE to SET a field to NULL? »
I have the following query: UPDATE managed_avs SET own_license_expires_at = CASE id WHEN 50 THEN NULL END WHERE id in (50) I get the follow...
(1) odpowiedzi
2017-02-06 01:02 Read .sql files to disk with PostgreSQL »
is there any way to read file names stored in a folder on the disk and filtering through the extension? This could do with sql server, but now I need ...
(1) odpowiedzi
2017-02-05 15:02 How to pass a parameter and cast to a certain data type inside a function? »
I'm attempting to write a plpgsql function to insert a record into a table that expects some timestamps in certain columns. Here is the function: cre...
(2) odpowiedzi
2017-02-05 14:02 Doctrine2 native query does not hydrate custom type »
In a ZF2 - PostgreSQL application, I want to use Doctrine2 native queries to build paginator lists. So, it works great if any custom Doctrine / Pgsql...
(1) odpowiedzi
2017-02-05 09:02 Initialize model with integer array in Postgres »
I'm using postgres 9.6.1, Rails 4.2.0, and the following migration: class CreateStageBatches < ActiveRecord::Migration def change create_tab...
(1) odpowiedzi
2017-02-04 18:02 Looped CopyTo Query »
I have the following table: writing_agent_number|agent_name |individual_sub_name -------------------- ----------------- -------------------- 30...
(1) odpowiedzi
2017-02-04 11:02 Mattermost 3.6.2 Ubuntu 16.04 pgsql 9.5 db dial err issue »
I'm facing of an issue when trying to test mattermost server sudo -u mattermost ./platform [2017/02/04 11:19:31 CET] [INFO] Loaded system translatio...
(1) odpowiedzi
2017-02-04 09:02 How to get inet in entity class in spring using hibernate »
public List getAllEmployees() { return sessionFactory.openSession().createSQLQuery("select * from employee order by eid").list(); } ...
(1) odpowiedzi
2017-02-03 23:02 PostgreSQL: 42883 Operator does not exist: timestamp without time zone = text »
I am using Npgsql 3.0.3.0 and PetaPoco latest version. When I run this command: var dateCreated = DateTime.Now; // just an example var sql = new Sq...
(2) odpowiedzi
2017-02-03 12:02 Django / PostgresQL jsonb (JSONField) - convert select and update into one query »
Versions: Django 1.10 and Postgres 9.6 I'm trying to modify a nested JSONField's key in place without a roundtrip to Python. Reason is to avoid race ...
(1) odpowiedzi
2017-02-03 07:02 Find occurance of string using generate_series »
Query : select id , DATASTRING from mixdatatable Output : id DATASTRING 1 131A131A- - <> <...
(3) odpowiedzi
2017-02-03 00:02 SQL join arbitrary information to form a mixed list »
I have a list of items of different Types with their respective ID. Items will be grouped together by a group ID: Type | ID | GroupID ------------...
(2) odpowiedzi
2017-02-02 19:02 Postgresql - Regex split csv line with potentials quotes »
I would like to split a column that represent a csv line in postgres. Fields in this text line are delimited by pipe, sometime they are enclosed by qu...
(1) odpowiedzi
2017-02-02 17:02 Scanning results from DB query that contain a % character »
I'm reading data from a postgreSQL DB in my GO code, which works smoothly until I try to scan column values of type string containing the character %....
(2) odpowiedzi
2017-02-02 12:02 Is it possible to write right outer join where it would always be empty left part? »
Here is an example what I want. We have 2 tables - users and departments users: id name d_id 1 Alice 1 2 Bob 1 departments: id name 1 Sales 2...
(3) odpowiedzi
2017-02-02 10:02 PostgreSQL aggregate nodes recursively »
My table in postgres looks like below. Interpret those values in arrays as ID's of nodes that are connected in a directed graph. What I want to get is...
(1) odpowiedzi
2017-02-02 08:02 String Manipulation throws error while Inserting into PostgreSql Jsonb Column »
I have the following code, to insert data into my table res(ID bigserial, Results jsonb not null). I want to insert data so that 'Display' column a...
(1) odpowiedzi