Data dodania Pytanie
2017-10-11 23:10 How do you create a query which returns dynamic column names in Postgresql? »
I have two tables in a reporting database, one for orders, and one for order items. Each order can have multiple order items, along with a quantity fo...
(1) odpowiedzi
2017-10-11 18:10 PostgreSQL Materialized View Refresh "stacking" »
Version: 9.4.10 Do requests to refresh a materialized view stack? Ex: I have a materialized view which refreshes concurrently based off of an INSERT/...
(1) odpowiedzi
2017-10-11 17:10 PostgreSQL - Will it ever use two indices on the same table? »
Say you have a table with some indices: create table mail ( identifier serial primary key, member text, read boolean ); create index on ...
(2) odpowiedzi
2017-10-11 14:10 How to make rails query unique by a column »
I have a Company model that has many Disclosures. The Disclosure has columns named title, pdf and pdf_sha256. class Company < ActiveRecord::Base ...
(6) odpowiedzi
2017-10-11 13:10 Can PostgreSQL's to_tsvector function return tokens/words and not lexemes? »
PostgreSQL's to_tsvector function is extremely useful but in regards to my data set it does a little more than I want it to. For instance: select * ...
(1) odpowiedzi
2017-10-11 00:10 Rails and Postgres, group by hstore »
I have an 'Audit' model with name:string and data:hstore attributes - as follows: #<Audit id: 1, name: "my audit", data: {"publisher"=>"some...
(2) odpowiedzi
2017-10-10 21:10 cfloop to total integer values from SQL »
I am fairly new to Coldfusion. I am trying to run a cfloop where I go through the months to date from a PostgreSQL table, and add the integer values i...
(1) odpowiedzi
2017-10-10 16:10 how to update JSONB column using knexjs, bookshelfjs »
I have a JSONB column in PostgreSQL database like {lat: value, lon: value}. I want to change any specific value at a time eg. lat, but I am not sure h...
(1) odpowiedzi
2017-10-10 13:10 PostgreSQL Parametric Window Size »
Does anyone know if SQL Standards define and PostgreSQL will implement (10.x or higher) Parametric Window Size? Bellow a MVE of what I call a paramet...
(1) odpowiedzi
2017-10-10 12:10 how to start postgres prior to run docker »
I am super embarrassed to ask this question, because it seems a very basic one, but somehow I can't find the answer in docs. I have a django app that...
(3) odpowiedzi
2017-10-10 11:10 How to have SQL query with 2 subqueries divided »
I have a database which has these tables: Users (id, email) Trips (id, driver_id) MatchedTrips (id, trip_id) I need to get for each user the total...
(2) odpowiedzi
2017-10-10 10:10 How to delete record when there is a deadlock of foreign keys? »
I have two tables p and u as following: (PostgreSQL 9.3) CREATE TABLE p ( pid integer NOT NULL, uid integer, CONSTRAINT p_fkey FOREIGN KEY (uid...
(2) odpowiedzi
2017-10-10 09:10 Missing table name in IntegrityError (Django ORM) »
I am missing the table name in IntegrityError of Django: Traceback (most recent call last): ... return self.cursor.execute(sql, params) File "....
(3) odpowiedzi
2017-10-10 09:10 Inner join with postgres array field »
We have a CMS using rails,react and postgresql. We have pages and pieces stored in our table. Each page consist of a set of pieces (An array field). ...
(1) odpowiedzi
2017-10-10 07:10 How to append object in postgresql jsonb field while update »
I want to update my jsonb field it store array of object. i want to add new object in it. CREATE TABLE justjson ( id INTEGER, doc JSONB); INSERT INTO...
(1) odpowiedzi
2017-10-10 01:10 postgres index optimization jsonb »
I am on postgres 9.5. I have a table which is as below CREATE TABLE public.info ( metadata jsonb, state text, active boolean name tex...
(0) odpowiedzi
2017-10-09 18:10 Refresh a materialized view in database transaction »
Is it possible to refresh a materialized view in a database transaction? I'm writing test cases for complex queries in laravel which uses transactio...
(1) odpowiedzi
2017-10-09 17:10 Postgres: count unique array entries from subquery »
If my subquery foo liberates the rows:- ID, USERS 1 {23129} 2 {23142} 3 {23300,23300} 4 {23129,23300} How can I get a count of unique user...
(3) odpowiedzi
2017-10-09 15:10 updating existing records with a unique integer »
I have an existing table with records in it and I've just added a new column ver which I would like to be unique. create table foo ( bar text, ve...
(3) odpowiedzi
2017-10-09 13:10 Rails ActiveRecord inserting/updating range type (Postgresql) »
I have a height_ranges table on my database, which stores numeric ranges. migration file class CreateHeightRanges < ActiveRecord::Migration de...
(1) odpowiedzi
2017-10-08 23:10 Design for relation database with object structure »
I am designing database for my app. I am using PostgreSQL. It has to be generic app and real world structure looks like this: Category (e.g. vegetati...
(1) odpowiedzi
2017-10-08 19:10 Postgresql- Merge data from multiple tables only if »
I am looking for a way to Join two columns on Id. Table2 id has duplicate id. I need to filter Id where test has a minimum value and associated test2...
(1) odpowiedzi
2017-10-08 15:10 PostgreSQL - Grant select on all tables (and future tables), in *all schemas* »
My database uses schemas to separate tenant-specific data for an application - each customer has a brand new schema created when they sign up to hold ...
(1) odpowiedzi
2017-10-07 20:10 Place complex uniqueness constraint in Postgres? »
In Postgres, I have a table user_badge containing three columns, appearing as something like the following. # select * from user_badge; id | user_id...
(1) odpowiedzi
2017-10-07 17:10 How should I make a follow system sql or nosql? »
I'd like to programm a system where a user can follow another user but I don't know if I should do it with a nosql db like mongodb or any other or is ...
(1) odpowiedzi
2017-10-07 14:10 Fast complex SQL queries on PostgreSQL database with Python »
I have a large dataset with +50M records in a PostgreSQL database that require massive calculations, inner join. Python is the tool of choice with Ps...
(3) odpowiedzi
2017-10-06 21:10 Why do you need to include a field in GROUP BY when using OVER (PARTITION BY x)? »
I have a table for which I want to do a simple sum of a field, grouped by two columns. I then want the total for all values for each year_num. See ex...
(1) odpowiedzi
2017-10-06 20:10 How to use postgres jsonb operator '?' in laravel 5 »
I'm trying to run a query with jsonb ? operator https://www.postgresql.org/docs/9.6/static/functions-json.html. In database console its ok, but i can...
(0) odpowiedzi
2017-10-06 13:10 SHOW ALL equivalent for custom settings »
Is there equivalent to show all or select * from pg_show_all_settings() but for custom settings? If I do this: select * from set_config('myconf.test...
(0) odpowiedzi
2017-10-06 02:10 PHP SilverStripe ORM: Duplicate key value violates unique constraint for DataObject write »
I have a function on my website that saves a bunch of values quite quickly to the same DataObject type. Most of the time it's OK but occasionally I ge...
(2) odpowiedzi
2017-10-06 00:10 Hibernate 3.3 and Postgres 9.4 »
I have a project, where I have to use Postgres 9.6, having Hibernate 3.3 in legacy code. The bestchoice for me is NOT to upgrade hibernate, but since ...
(0) odpowiedzi
2017-10-05 20:10 SQL query dont work correct in postgresql database »
I have a simple SQL query where help me to find it the values have some English letter in text of field. here the SQL : select id,field1 from mytab...
(2) odpowiedzi
2017-10-05 12:10 How to do not select duplicated values from db? »
I have the following comment table(comment and corresponding info including photo_id) comment_id | photo_id | ... com_1 | pho_1 | ... co...
(1) odpowiedzi
2017-10-05 08:10 Postgres select highest of ordered settings with default (sql fiddle) »
Say I have a few settings scoped to users, but always having a default (when user_id is NULL): settings: name | value | user_id | confirmed __...
(2) odpowiedzi
2017-10-05 02:10 PostgreSQL: Is there a way to clone a row of data in order to populate a table with test data? »
I'm looking for a quick way to populate a table full of constraints and complications to essentially clone two rows over a thousand times, in order to...
(1) odpowiedzi