Data dodania Pytanie
2017-07-29 17:07 Can Postgres specify which field triggered an error? »
Let's say I run a query like this (just a made-up example): update foo_table set field1=10000000000000, field2=100000000000000 where id=1; And I ge...
(1) odpowiedzi
2017-07-29 16:07 How to check if an array is in a multidimensional array »
I'd want to check, using a filtering query, if an array is equal to an element of another multidimensional array which can be considered as an array o...
(2) odpowiedzi
2017-07-29 15:07 SEGFAULT when creating own index in postgresql for POINT3DZ »
I'm trying to write my own index for 3d points - POINT3DZ (using pgis and postgres 9.4). I have written a code similar to spgquadtreeproc.c [1] This...
(0) odpowiedzi
2017-07-29 14:07 Update hidden attribute in LoopbackJS »
I have a strange problem in LoopbackJS. In one of my persisted models which are saved in PostgreSQL, I am not able to change the value of some fields ...
(1) odpowiedzi
2017-07-28 22:07 postgresql - how to extract a list of past and known future offset changes for a timezone »
Postgresql is rather good at handling timezones, using the classic tzdata database. The server can convert past and future timestamps between the dif...
(1) odpowiedzi
2017-07-28 19:07 Math calculating with two JSONB keys in Postgres? »
I have JSONB column with data like: {"plays": {"win": 90, "draw": 8, "lose": 2}} How I can calculate sum with win and draw keys? Something like: ...
(2) odpowiedzi
2017-07-28 19:07 Slow regex query on 80M record in PostgreSQL »
I have a read-only table with 80 million rows : Column | Type | Modifiers | Storage | Stats target | Description ----------...
(1) odpowiedzi
2017-07-27 21:07 SQL select with dynamic counts »
Suppose I have a table foo from which I'd like to select N rows from each category create table foo(name text, category text); name | category ---...
(2) odpowiedzi
2017-07-27 20:07 Spring JPA Sorting and Paging with PostgreSQL JSONB »
I am using Spring JPA in order to manage my PostgreSQL data. This data makes heavy use of the jsonb data type in PostgreSQL 9.4. My table (called job...
(0) odpowiedzi
2017-07-27 19:07 Postgres: Always use default column value, even if insertion is attempted »
I'm creating a user table using postgres. My table is the following... create table if not exists "user" ( user_id bigserial primary key, use...
(3) odpowiedzi
2017-07-27 11:07 Getting "number of referencing and referenced columns for foreign key disagree" in PostgreSql »
I'm creating a few tables in pgAdmin 4, but I keep getting the error it the title for some reason, can you spot why? I don't see any problem and i've ...
(1) odpowiedzi
2017-07-26 23:07 How do I query for empty jsonb arrays in Postgres, Activerecord, Rails 5 »
I have a Post model with the column defined by the following migration: add_column :posts, :comments, :jsonb, default: [] add_index :posts, :comment...
(1) odpowiedzi
2017-07-26 15:07 Array of composite type as stored procedure input passed by C# Npgsql »
I've read several questions and topics related to the issue but none of them actually helped me to solve my problem and none of them actually were rel...
(0) odpowiedzi
2017-07-26 12:07 Uploading a CSV file, distorted characters »
I am having a problem when uploading a csv file through the following query, COPY adwords_initial("Account", "Week", "Campaign", "Keyword", "Ad group...
(1) odpowiedzi
2017-07-26 10:07 Calling an external API whenever a field in the database is updated »
My ApplicationUser model contains a property: public bool SubscribedToNewsletter { get;set; } I would like to make sure that whenever I update its ...
(2) odpowiedzi
2017-07-26 02:07 Postgres could not create unique index, key is duplicated »
I'm trying to add a column to a table in my Postgres 9.3 database with this seemingly simple SQL: ALTER TABLE quizzes ADD COLUMN deleted BOOLEAN NOT ...
(2) odpowiedzi
2017-07-25 23:07 Get max or min of parameter to row value postgres »
For a parameterized postgresql query, how can I return either the value in the row or the parameter provided. I have a table (we will call it foo) wi...
(1) odpowiedzi
2017-07-25 18:07 psycopg2 kills query after 3 minutes »
I am using psycopg2 version 2.6.1, whenever I run a query to a remote server, if its less than 3 minutes it will run perfectly, but if it runs for mor...
(0) odpowiedzi
2017-07-25 17:07 Techniques to Avoid Problems with Django Migrations? »
I'm building an e-commerce website with Django 1.8 and PostgreSQL 9.4. I'm interested in learning what techniques I can use when I change my database...
(1) odpowiedzi
2017-07-25 09:07 Filtering openstreetmap data for postgis »
I am creating a postgis database and want to use filtered OpenStreetMap data. For this i have tried the following process: Downloaded the planet....
(1) odpowiedzi
2017-07-24 19:07 Custom query on sequelize seeder »
Any one know how to custom select query on sequelize seeder I have tried two ways, but no one work First attempt up: function(queryInterface, Seq...
(1) odpowiedzi
2017-07-24 17:07 Reference on Foreign Table Postgres 9.5 »
I am using oracle_fdw to connect from a postgres 9.5.3 to an Oracle database. The server and user mappings have been created on the postgres db: ...
(1) odpowiedzi
2017-07-24 15:07 Strange JSON interpretation (polymorphic type), how to workaround? »
This legal(!) CASE construct returns a JSON datatype: SELECT CASE WHEN true THEN to_json(1) ELSE to_json('hello') END; but: ERROR: could not ...
(1) odpowiedzi
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 11:07 How to avoid duplicate data in my database in ruby on rails »
I have scrap a data from another website and saved it in my database which is working fine. However, anytime I refresh my application the scrapped dat...
(3) 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-24 02:07 What is the syntax for AND OR NOT in Postgres trigram search? »
I have implemented Postgres 9.6 trigram search https://www.postgresql.org/docs/9.6/static/pgtrgm.html into my application which works fine for a singl...
(1) odpowiedzi
2017-07-23 17:07 Simple WHERE EXISTS ... ORDER BY... query very slow in PostrgeSQL »
I have this very simple query, generated by my ORM (Entity Framework Core): SELECT * FROM "table1" AS "t1" WHERE EXISTS ( SELECT 1 FROM "...
(3) odpowiedzi
2017-07-23 16:07 What should I do with my pg_log? »
I have two database server, one for main usage and the second is for standby. The log file is being recorded every day. About last week, when I found ...
(1) odpowiedzi
2017-07-23 12:07 How to change sequence using SQL Query »
I want to change some data in a table with _id_seq suffix with this sql query: UPDATE user_custom_fields_id_seq SET last_value = 1000; but I get th...
(1) odpowiedzi
2017-07-23 10:07 In postgres how can I create a custom type that is simply a timestamp truncated to minutes »
I have a column "event_datetime" that is in many tables and I need it to be truncated to the minute. I dont want to create triggers in all the places ...
(1) odpowiedzi
2017-07-22 14:07 CITEXT: which solution I should use for tests with JPA? »
I need to test psql citext with JUnit using hsqldb Step 1 Use liquibase to set up psql-dialect to hsqldb <changeSet id="5" author="ustimenko" co...
(1) odpowiedzi
2017-07-22 12:07 camelCase column in postgresql database in rails (ActiveRecord) »
I have Post model. It has title and body. I want to add short description in there. Although, I know how to do it with snake_case (i.e. short_descript...
(2) odpowiedzi
2017-07-22 01:07 Postgres 9.4.12 Slow queries »
I'm having slow queries with my postgres in a table with 9 million rows. Query: EXPLAIN (ANALYZE, BUFFERS) SELECT date_point, geo, alarms, status FRO...
(1) odpowiedzi
2017-07-22 00:07 Django table rows are being magically hidden from ORM when I set a 'deleted' flag »
Working in an inherited codebase. I have a table with 2 objects when I look at it from the API or from the admin site, but it has 3 objects when I do...
(1) odpowiedzi