Data dodania Pytanie
2017-03-12 07:03 could not connect to server:PostgreSQL -Heroku »
I deployed a Django app in Heroku. Initially, it was run on SQLite3 database and later I upgraded to PostgreSQL. App is working perfect with local set...
(1) odpowiedzi
2017-03-12 04:03 Efficient retrieval of latest value in a large table PostgreSQL »
Currently after working to get an efficient way to query a table in the format below I am using this query... select distinct on (symbol, date) date,...
(4) odpowiedzi
2017-03-12 00:03 postgresql create bitset from query by primary key »
I have a big table with primary autoincrement key. Sometimes i need to build bitmask for current filtering query on this table(which rows suit for my ...
(0) odpowiedzi
2017-03-11 22:03 Getting PG:UndefinedTable: ERROR: when running migration to add friendships table (In development) »
I'm trying to build an app that has users and friendships. I am using Rails 5, Ruby 2.4.0, and PostgreSQL 9.5.6 I'm currently trying to implement th...
(1) odpowiedzi
2017-03-11 15:03 Postgresql - Opposite of string_agg »
I'm looking for a postgresql function that will do the opposite of string_agg. I have a movies table where the tags column contains values such as ...
(2) odpowiedzi
2017-03-11 15:03 How can I replay web requests on a production clone to control a release candidate? »
I have a critical Rails app running in production with a fairly standard setup: Rails 5 API, Puma, PostgreSQL, Sidekiq, Heroku. I also have a branch t...
(0) odpowiedzi
2017-03-11 01:03 Unexpected deadlocks in Postgresql (while using psycopg2) »
I am dealing with a deadlock issue in PostgreSQL that I do not understand. I am trying to implement a Round Robin-like algorithm using Python, psycop...
(1) odpowiedzi
2017-03-10 21:03 3 level nested sorting »
I'm trying to implement a 3 level nested sort. Basically I have four columns: A | B | C | D --- | --- | --- | --- bob | GOOD| 1 | kat | ...
(2) odpowiedzi
2017-03-10 21:03 guarantee uniqueness of table relationship »
So I have a table of states. CREATE TABLE public.states( state_code char(2) NOT NULL ); I have several different ways of grouping those states i...
(2) odpowiedzi
2017-03-10 16:03 Flask Admin on postgres database view »
Is there a way I can create admin view on Flask-Admin on a database view? I'm using Postgres, and have created a view, let's take the below one as exa...
(3) odpowiedzi
2017-03-10 06:03 Concatenate two columns and replace one of them with a result in postgresql »
I have a table where in column location there is the folder of the file, e.g. '/home/ubuntu/test' and in the name column, there is the filename e.g. ...
(1) odpowiedzi
2017-03-09 19:03 Locate popular strings with PostgreSQL »
I have a bunch of text rows in a PostgreSQL table and I am trying to find common strings. For example, let's say I have a basic table like: CREATE T...
(2) odpowiedzi
2017-03-09 12:03 How to use same list twice in WHERE clause? »
My SQL query contains a WHERE clause looking like this: WHERE name1 in ('Emily', 'Jack', 'James', 'Chloe') OR name2 in ('Emily', 'Jack', '...
(3) odpowiedzi
2017-03-09 12:03 Clear PostgreSQL database for all content »
I want to remove all content from a database without dropping and re-creating the database. I figured out that dropping all schemas, re-creating 'pub...
(1) odpowiedzi
2017-03-09 00:03 Injecting JSON parameter in nativeQuery - Spring JPA »
This works when @Query(value = "SELECT * FROM person WHERE school = :schoolId AND details @> '{\"id\":\"1234\",\"name\":\"John\"}'", nativeQuery ...
(1) odpowiedzi
2017-03-08 21:03 Postgres JSON array contains given array element »
I have been searching for this answer for long on stackoverflow, but did not find anything useful. I have data in my_tbl as: folder_id | links ...
(1) odpowiedzi
2017-03-08 18:03 Using Postgres JSON Functions on table columns »
I have searched extensively (in Postgres docs and on Google and SO) to find examples of JSON functions being used on actual JSON columns in a table. ...
(2) odpowiedzi
2017-03-08 15:03 Suggest appropriate index on my database »
I have a table product Product(id BIGINT, ... Some more columns here expired DATE); I want to create index on expired field for...
(2) odpowiedzi
2017-03-08 15:03 How to list each pair of tuple only once irrespective of column order in SQL and relational algebra? »
I'm working on some book exercises and can't find an explanation on how to express the following in relational algebra. I did find an answer for SQL t...
(2) odpowiedzi
2017-03-08 10:03 Hibernate, PostgreSQL : Could not extract resultset, SQLState 25P02 »
I am working on one of our test-servers and getting an error from the hibernate when I am trying to call a method, where I get the Person object by it...
(1) odpowiedzi
2017-03-07 23:03 Get access to OLD.myLoopVariable / NEW.myLoopVariable in a plpgsql trigger function? »
I try to get access to a loop variable that is a column name of a table, to get old and new data of each column. CREATE FUNCTION my_function() RETURN...
(2) odpowiedzi
2017-03-07 19:03 Setting up the Database on Heroku. bundler: failed to load command: thin , LoadError: cannot load such file -- dm-postgres-adapter »
so I'm trying to do some Sinatra tutorial (JUMP START SINATRA by Darren Jones - https://www.sitepoint.com/premium/books/jump-start-sinatra) And it wo...
(0) odpowiedzi
2017-03-07 13:03 PostgreSQL, Function LAST WHERE? »
Once again appears problem which I dont know to solve due to lacks in my SQL knownledge. Let me "draw" it. DROP TABLE IF EXISTS mytry; CREATE TABLE ...
(2) odpowiedzi
2017-03-07 12:03 Entity Framework and Postgresql: stored procedures »
I'm using Entity Framework with postgresql. A common case is that I'd like to select a function result as a part of a query, like SELECT t.id, func1(...
(0) odpowiedzi
2017-03-06 23:03 PostgreSQL efficiently find last decendant in linear list »
I currently try to retrieve the last decendet efficiently from a linked list like structure. Essentially there's a table with a data series, with cer...
(1) odpowiedzi
2017-03-06 20:03 Filter a top level JSONB array document in Postgres? »
I have a Postgres table named 'events' with a column of 'id', 'name', 'invoices': Table "public.events" ...
(1) odpowiedzi
2017-03-06 17:03 Return NULL instead of composite value from PostgreSQL function »
Let us have the following things in PostgreSQL: CREATE TYPE struct AS (x INT, y INT); CREATE TABLE tbl (a INT, b struct); CREATE FUNCTION find_tbl_e...
(2) odpowiedzi
2017-03-06 16:03 how to create associated record and modify data with has_one »
I am a rails newbie and although I have built an app with erb files, ruby and postgres, I find it difficult to find out how to write the syntax for th...
(2) odpowiedzi
2017-03-05 23:03 Postgres JSONB support on zend/Db Zend Framework 3? »
how can i work with JSONB (postgresql) in zend framework 3?. for example i want make query's like this SELECT id, data->'title' AS title, data-&g...
(0) odpowiedzi
2017-03-05 19:03 Postgres not using partial timestamp index on interval queries (e.g., now() - interval '7 days' ) »
I have a simple table that store precipitation readings from online gauges. Here's the table definition: CREATE TABLE public.precip ( ...
(2) odpowiedzi
2017-03-05 11:03 PostgreSQL: Connection refused while connecting with JDBC »
My Maven application returns a java.net.ConnectException: Connection refused (Connection refused) while connecting to a PostgreSQL database. I'm worki...
(0) odpowiedzi
2017-03-05 01:03 Exclude "grouped" data from query »
I have a table that looks like this (simplified): CREATE TABLE IF NOT EXISTS records ( user_id uuid NOT NULL ts timestamptz NOT NU...
(1) odpowiedzi
2017-03-04 18:03 Migration from PostgreSQL to Mysql - Invalid timestamp literal detected »
I am using MysqlWorkBench to migrate a PostGreSQL database, but I'm running into issues with the timestamp columns. The PostgreSQL database is using ...
(1) odpowiedzi
2017-03-04 17:03 Where in Devise does Devise issue SQL? logout crashes »
This is (at least) a two part question. Every time I do a git commit I also do a VMWare snapshot. Using VMWare and Git I have managed to isolate whi...
(0) odpowiedzi
2017-03-04 14:03 Inserting into many-to-many relationship table with a returned id »
Take the following tables CREATE TABLE album( id SERIAL PRIMARY KEY NOT NULL, duration INTEGER NOT NULL ); CREATE TABLE genre( id SERIAL PRIMA...
(1) odpowiedzi