Data dodania Pytanie
2017-12-09 21:12 Unpivot PostgreSQL large number of columns? »
I am trying to unpivot a large dataset, with 250 columns. There is a very good documented solution here unpivot and PostgreSQL. However, it inputs th...
(1) odpowiedzi
2017-12-09 19:12 Foreign keys with Sequelize and Typescript »
Given these 2 Sequelize models: export class Users extends Model<Users> { @HasMany(() => UserRoles) @Column({ primaryKey: true, all...
(0) odpowiedzi
2017-12-09 15:12 Postgresql jsonb default insert value with dynamic timestamp »
I have a status column in my postgres database with the type jsonb I can prepopulate the json with something like this. CREATE TABLE ... status js...
(1) odpowiedzi
2017-12-09 12:12 PostgreSQL SELECT, UPDATE and INSERT together »
I'm currently trying to SELECT columns from a table, do some arithmetic with the selected values and then INSERT the updated values back into the same...
(2) odpowiedzi
2017-12-09 09:12 Update value of attribute with count condition requirement »
I have a data query result from query select count(type_of_vegetation)as count,type_of_vegetation from tb_patrol group by type_of_vegetation as ...
(1) odpowiedzi
2017-12-08 19:12 Django: Moving data from SQLite to PostgreSQL »
I've recently inherited a production codebase for a webapp written using Django. Up until now, the database the project has been using has been the d...
(2) odpowiedzi
2017-12-08 18:12 PostgreSQL IGNORE NULLS in window functions »
On the left panel data without IGNORE NULLS. On the right panel data with IGNORE NULLS. So I need to get right variant in PostgreSQL Need to emula...
(2) odpowiedzi
2017-12-08 16:12 RDS instance unusably slow after restoring from snapshot »
Details: Database: Postgres. Version: 9.6 Host: Amazon RDS Problem: After restoring from snapshot, the database is unusably slow. Why: Something AW...
(1) odpowiedzi
2017-12-08 08:12 object_changes contains numeric values serialized as strings and this causes a new Version to be created even if no attribute was changed »
Someone experienced this bug too ? Maybe this is the expected behaviour ? I'm using rails 3.2.3 with paper_trail 5.2.3 and postgreSQL 9.3.6 In orde...
(0) odpowiedzi
2017-12-07 23:12 Postgres pg_dump cache lookup failed for index »
I am trying to create a back-up of a postgres database using the following command (omitting details): $ pg_dump -h $host -p 5432 -U $user $db > d...
(2) odpowiedzi
2017-12-07 23:12 Filtering set returning function results »
I'm hoping to clarify my understanding of how set returning functions behave behind the scenes in PostgreSQL. Let's set I have a set returning functi...
(1) odpowiedzi
2017-12-07 11:12 Date failing to update, but returning true for Update (Rails ActiveRecord) »
I have a Rails model called user that has a birthday field with type date in Postgres. My first issue is that I'm not sure how to update the value of...
(1) odpowiedzi
2017-12-06 23:12 What happens when a SQL query runs out of memory? »
I have a Postgres Server on AWS with a table (mytable) that is 100GB in size. When I query the data from my laptop, for example if I do select * fr...
(2) odpowiedzi
2017-12-06 17:12 How to disambiguate a plpgsql variable name in a ON CONFLICT clause? »
Given this table: create table test ( name text primary key ); I need to write a plpgsql function with a variable name that collides with the p...
(2) odpowiedzi
2017-12-06 08:12 How does PostgreSQL's CLUSTER differ from a clustered index in SQL Server? »
Many posts like this stackoverflow link claim that there is no concept of a clustered index in PostgreSQL. However, the PostgreSQL documentation conta...
(1) odpowiedzi
2017-12-05 21:12 *10 upstream timed out (110: Connection timed out) while reading response header from upstream with uwsgi »
I currently have a server setup with nginx and uwsgi with django This error doesn't happen until I try to change my rds instance my fully error messa...
(1) odpowiedzi
2017-12-05 16:12 PostgreSQL database size is not reasonable »
In my postgresql 9.6 instance I have 1 production database. When I query the size of all databases : combit=> Select pg_database.datname,pg_size_...
(0) odpowiedzi
2017-12-05 16:12 Hibernate two ManyToOne relations on one Table, the first gets Eager and the second LAZY loaded »
I have got the following Entities, an item which can has up to two categories, a primary and a secondary. Both categories are mapped ManyToOne to the ...
(1) odpowiedzi
2017-12-05 04:12 PostgreSQL: /opt/PostgreSQL/9.6/lib/postgresql/plperl.so: undefined symbol: Perl_save_strlen »
I am trying to create plperl extension in PostgreSQL 9.6 (EDB single click executable file) postgres=# create extension plperl; ERROR: could...
(0) odpowiedzi
2017-12-04 21:12 postgresql trigger - Instead of insert dont work »
This code works: CREATE TRIGGER HandleRegistration BEFORE INSERT ON Registered FOR EACH ROW EXECUTE PROCEDURE registration_handler();...
(1) odpowiedzi
2017-12-04 17:12 Can we define a GROUP_CONCAT function in PostgreSQL? »
I have several lines of SQL code for my legacy database with GROUP_CONCAT statements, as in: SELECT SUM(age), GROUP_CONCAT(sal) FROM Users; In Post...
(2) odpowiedzi
2017-12-04 11:12 Postgresql: array_agg DISTINCT and ORDER »
I'm trying to make a query in postgresql for include results from 2 (or more) tables using left join lateral, and I need to have one record for each r...
(0) odpowiedzi
2017-12-04 10:12 Run Batch File In postgresql in single click »
Hello Experts I have made batch file to run query in postgresql it works fine after pressing enter key 4 times without typing. 1-server, 2 database, 3...
(1) odpowiedzi
2017-12-04 09:12 how to query nested array JSON in postgres? »
I have following structure of JSON document storing in one of my POSTGRES table link to the sample JSON is here here in that JSON , i have below s...
(0) odpowiedzi
2017-12-04 07:12 POSTGRES : SELECT : Query for number of rows which EXIST BETWEEN given range »
I have to query the table to search for given conditions : order_no specified in the range must exist. Example: I am getting a request for a rang...
(3) odpowiedzi
2017-12-04 06:12 Count variables per group at time intervals »
I am collecting data about a fleet of vehicles at 10 minute intervals. The following query returns 144 rows as expected (the number of 10-minute inter...
(1) odpowiedzi
2017-12-03 21:12 PostgreSQL docker image build errors »
I am creating a docker image for postgresql installation from sources. Here is my Dockerfile which I created according to the postgresql documentation...
(2) odpowiedzi
2017-12-03 21:12 CTE Execution Order »
In the following CTE statement: CREATE TABLE test_table (Field1 INTEGER, Field2 INTEGER); CREATE TABLE test_table2 (Field1 INTEGER, Field2 INTEGER); ...
(1) odpowiedzi
2017-12-03 03:12 2 Functional Dependencies in a single table »
I'm trying to create a schema based on these 2 Functional Dependencies. A -> B, C, D B -> D I'm trying to create a single tabl...
(1) odpowiedzi
2017-12-02 19:12 Postgresql - Split data from a column into two columns »
I have a small Porstgre database where I a have a table with several columns. One of those columns contains data like this : test1 (80%) test2 (21%) t...
(2) odpowiedzi
2017-12-02 07:12 SQL: how to select the time range of an employee and group by timeframe interval 30mins »
I have three columns, time-in(timestamp), time-out(timestamp) and employee. I need to get the number of employees that work in a specific timeframe (3...
(4) odpowiedzi
2017-12-02 02:12 Insert conditionally on number of rows matching condition in Postgres »
I have a table like this: create table if not exists features ( username text not null, feature text not null, attributes text[] not...
(1) odpowiedzi
2017-12-01 17:12 No operator matches the given name and argument type in pg backed rails app »
First I implemented a sample search functionality a rails app using SQLITE as the database. And the query was as follows: @productions = Production....
(1) odpowiedzi
2017-12-01 14:12 Filtering by categories with rails »
I have 2 models Recipe and Category, they associated with has_and_belongs_to_many, now I need to filter recipes by categories, when user checks catego...
(1) odpowiedzi
2017-12-01 10:12 What does this "t" do? »
I'm having trouble understanding the following example from the PostgreSQL documentation: -- set returning function WITH ORDINALITY SELECT * FROM pg_...
(2) odpowiedzi