Data dodania Pytanie
2017-11-21 04:11 Optimal approach for large bulk updates to indexed bit sets »
The environment for this question is PostgreSQL 9.6.5 on AWS RDS. The question is about an optimal schema design and batch update strategy for a tabl...
(1) odpowiedzi
2017-11-21 03:11 remove duplicate values given it is false or true »
So if I have a table: col1 | col2 x | f x | t y | t z | t q | f q | t For all the duplicate values I want ...
(2) odpowiedzi
2017-11-20 23:11 Rails 5 accepts_nested_attributes_for/has_many :through »
How do I create a new model containing a reference to an association (many-to-many, using has_many :through) which already exists? Here are the relev...
(0) odpowiedzi
2017-11-20 21:11 PostgreSQL: Serializable transactions with GRANT/DROP role »
I have been reading a lot about serializable transactions in Postgres, but came across an issue that I haven't been able to resolve. Let's assume that...
(1) odpowiedzi
2017-11-20 20:11 Postgres complicated full outer join keeping nulls from the "on" column »
I have written a PostgresSQL query that is relatively performant at scale and gives me the dataset I want back, but I am wondering if it is the simple...
(2) odpowiedzi
2017-11-20 16:11 Postgresql - SQL to Update a JSONB column type »
I have a table which has a column named "data" of type JSONB. I am trying to come up with a SQL statement to accomoodate the recent model changes. (po...
(0) odpowiedzi
2017-11-20 13:11 How to speed up nested JSON query in PostgreSQL? »
For our development of a flight retail engine we store orders as JSON documents in a PostgreSQL database. The order table is defined as: CREATE TABL...
(1) odpowiedzi
2017-11-20 12:11 Postgres Trigger in specified time »
Hello expert I am working in banking software vendor company and we are working in PostgreSQL database due to load of work in office time(pick hour) I...
(1) odpowiedzi
2017-11-20 07:11 Are floating point numbers the same in different systems conforming to IEEE754? »
This is related to my latest question: What can I do about the difference between real numbers in R versus PostgreSQL? I know very little about preci...
(1) odpowiedzi
2017-11-19 18:11 Undefined db connection with knex »
I am executing the following script, node acl.js: acl.js require('dotenv').config() const _ = require('lodash'); const buckets = require('./buckets...
(1) odpowiedzi
2017-11-19 11:11 Is it safe to delete archive_status log file in postgresql 10 »
I am not a DBA but i am using postgresql for production server and i am using postgresql 10 database. I am using Bigsql and i started replication of m...
(1) odpowiedzi
2017-11-19 02:11 maven compile errors when i'm trying to map entity to table in postgresql »
I need your help to map entity to table using PostgresSQL database , in fact what causes this error is that I tried to map an entity to a table, unfor...
(1) odpowiedzi
2017-11-18 16:11 Postgres filter nested jsonb object in select »
For ex I have a table like this, exclusive is jsonb column I want to select: Total number of case goinside = 1 Total Number of case type = 1, 2, 3 g...
(1) odpowiedzi
2017-11-18 15:11 Date gets changed when saved to DB »
I'm using PostgreSQL and I have a column named reservation_date which type is date. Also, I set my timezone to Tokyo in application.rb I try to save...
(0) odpowiedzi
2017-11-18 10:11 Use XML column in where clause in PostgreSQL »
I want to supporting where clause for columns which containing XML content in hibernate for some DBs. I've achived this in Oracle by extending org.hib...
(1) odpowiedzi
2017-11-18 09:11 KeyError: 'locations' in Django app »
I'm working on a Django application which fetches JSON data from an API and stores it in PostgreSQL database. But while migrating the app I'm getting ...
(1) odpowiedzi
2017-11-18 06:11 MYSQL create table, constraint, foreign key »
I am following along with a UDEMY course about SQL. The instructor is working in postgresql. I am working in MySQL workbench. Our corporate developme...
(1) odpowiedzi
2017-11-18 00:11 Wrong Calculation by User-Defined SQL-Function »
I have a function defined by CREATE OR REPLACE FUNCTION public.div(dividend INTEGER, divisor INTEGER) RETURNS INTEGER LANGUAGE 'sql' IM...
(2) odpowiedzi
2017-11-17 23:11 postgres query partitioned table on current_date »
I have a table in postgres with 10 millions of rows and it's partitioned per month by a date column 'created_on'. My problem is that I often need to q...
(1) odpowiedzi
2017-11-17 23:11 Postgres - Update Attribute of JSONB type colum »
I have a table which has a column named "data" of type JSONB. I am trying to create a migration script based on the recent model changes. (postgres 9....
(0) odpowiedzi
2017-11-17 17:11 SQL Query progress using PostgreSQL or My SQL »
Introduction Hello everyone. Working on web application management I often find myself having a problem that I have never solved with my current know...
(2) odpowiedzi
2017-11-17 17:11 Wildcard when Traversing JSONB Array in Postgres »
We're currently trialing JSONB as a data type for order data in a system we're building. As the document is fairly large, Here is the first part of it...
(1) odpowiedzi
2017-11-17 16:11 pg_search gem and fulltext search rank setting »
Im using the gem pg_search to perform fulltext search on my postgres db. I've a scope like this: pg_search_scope :fulltext, against: [:firstname, :la...
(1) odpowiedzi
2017-11-17 05:11 Can I depend on check constraint to ensure non-negative balance? »
I currently have a table as follows: CREATE TABLE Account ( ID int NOT NULL, Balance int, CHECK (Balance>=0) ); I also have some application ...
(2) odpowiedzi
2017-11-16 23:11 Using \COPY to load CSV with JSON fields into Postgres »
I'm attempting to load TSV data from a file into a Postgres table using the \COPY command. Here's an example data row: 2017-11-22 23:00:00 "{\"i...
(2) odpowiedzi
2017-11-16 09:11 PG::UndefinedColumn: ERROR in case of same DB is used for two different projects which are connected with each other in Rails »
I'm running two projects as a different repository with git. One is admit another one is Web in rails, both are connected with each other, Basically s...
(2) odpowiedzi
2017-11-16 02:11 Change the character encode in PostgreSQL C language function »
I am using PostgreSQL 9.5 64bit version on windows server. The character encoding of the database is set to UTF8. I'd like to create a function that ...
(1) odpowiedzi
2017-11-16 01:11 How to generate indexes for related fields on Django models? »
Say we're building a Django-based site that clones Medium.com's URL structure, where you have users and articles. We'd probably have this model: clas...
(1) odpowiedzi
2017-11-15 20:11 How to better optimize large query using raw SQL or Arel »
This post may frighten many of you, maybe especially the most senior craftsmen. Let's just say that being new to programming applications like this I ...
(0) odpowiedzi
2017-11-15 18:11 rake db:migrate - PG:: InvalidSchamaName ERROR: no schema has been selected to create in »
I am attempting to run a rake:db migrate on a postgres database for my rails application. rake:db drop (the db already existed I am fixing a bug that ...
(2) odpowiedzi
2017-11-15 09:11 Codeigniter select join giving duplicate results »
Hi everyone so I am having trouble of creating a query in codeigniter model which will give me this result. So far I have these tables on my database....
(2) odpowiedzi
2017-11-15 08:11 How can view depends on primary key constraint in postgres »
Sometimes while bulk data loading it's recommended to temporary drop constraints and indexes on table. But when I am doing this I faced with some prob...
(1) odpowiedzi
2017-11-14 20:11 Group records by created_at in ActiveRecord »
I'm trying to find how many records were created on a given day, to get something like this: User uploaded 5 objects two days ago User uploaded 12 o...
(1) odpowiedzi
2017-11-14 19:11 How to find maximum overlapping date ranges »
I recently came across this problem in an interview create table meetings(ID integer primary key, start_time varchar, ...
(1) odpowiedzi
2017-11-14 16:11 How to query where an array column contains one or more values with Active Record? »
I have a Rails 5 application, with a PostgreSQL 9.6 database. The application has Report model, with a department_ids array field, which is defined i...
(1) odpowiedzi