Data dodania Pytanie
2017-06-19 20:06 How to do exactly same thing as array_to_json(array_agg(tags.*)) for N columns »
I am currently using PostgreSQL JSON capabilities to create JSON objects out of my query so I can easily use it on my application or pass it to the fr...
(1) odpowiedzi
2017-06-19 18:06 Flask dynamic Google Maps markers (python, postgres, psycopg2) »
I'm creating a Flask app that pulls data from a postgresql database using psycopg2. For the user in each row, the database has latitude and longitude ...
(1) odpowiedzi
2017-06-19 15:06 SQL SUM and GROUP BY based on WHERE clause »
I'm running PostgreSQL 9.4 and have the following table structure for invoicing: id BIGINT, time UNIX_TIMESTAMP, customer TEXT, amount BIGINT, status...
(2) odpowiedzi
2017-06-19 10:06 Search with multiple parameter in postgresql ltree »
I planned to implement a database that using ltree as multiple level categorization. However i ran into trouble when i tried to get an entry with path...
(2) odpowiedzi
2017-06-18 23:06 Rails Postgres: set all fields in a table to zero, except for »
I have a number of tables in which I set all fields to zero, except for a few select ones (including foreign keys and some time values), on a weekly b...
(1) odpowiedzi
2017-06-18 21:06 SQL Joining and ordering invididual subjects by date »
So I have two SQL tables, one is a customer address book and the other is a purchase log. Customer Table Cust ID Cust Name 1 Adam 2...
(3) odpowiedzi
2017-06-18 19:06 query for ids inside JSONB using jsonb_each and LATERAL in postgres »
Imagine a super simple table such as: create table object ( id INT, data jsonb ); With some data: INSERT INTO object (id, data) VALUES (...
(2) odpowiedzi
2017-06-18 14:06 Which db manager for a 100Go Table? »
I realize a 2G / 3G / 4G data retrieval project as part of my studies. I have to store this data, and to make queries on it. My table : [freq {float},...
(1) odpowiedzi
2017-06-18 08:06 Rails 4.2: Error with input form with a json field »
In my Rails 4.2 app with postgres, the field ui_layout is converted into json in the db table (psql supports json data type). The ui_layout used to be...
(1) odpowiedzi
2017-06-18 00:06 Inconsistent statistics on expression with partial index »
[PostgreSQL 9.6.1 on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.2.0-10) 6.2.0 20161027, 64-bit] I have a table with timestamp ranges: create tab...
(2) odpowiedzi
2017-06-17 21:06 Docker: How to rely on a local db rather than a db docker container? »
Overall: I don't want my django app to rely on a docker container as my db. In other words, when I run an image docker run -p 8000:8000 -d imagename ...
(2) odpowiedzi
2017-06-17 17:06 How to print code, type of PostgreSQL / plpgsql exception »
Given this pl/pgSQL function drop function if exists f( float ); create function f( x float ) returns float language plpgsql as $$ begin ...
(1) odpowiedzi
2017-06-17 13:06 postgres jsonb array index »
I have created a model in loopback with 3 properties connected to postgres. Among the properties defined, I have one array property. My model is defin...
(0) odpowiedzi
2017-06-17 11:06 Generating PHP Passwords for a database without PHP »
PHP includes a pair of functions to generate and validate passwords, using, I believe, BCrypt. This makes it easy to use password hashes stored in a d...
(2) odpowiedzi
2017-06-16 22:06 Commit a nested transaction »
Let's say I have a method that provides access to an API client in the scope of a user and the API client will automatically update the users OAuth to...
(1) odpowiedzi
2017-06-16 19:06 Using Postgres jsonb type to store array of values vs collection of key/value pairs »
I have a jsonb type column named selection in a postgres database. I can store the document in it as { 'selection': ['foo', 'bar'] } or just ['foo'...
(1) odpowiedzi
2017-06-16 12:06 Postgres select duplicate on one column but different on another »
I have a database with two columns: author_id, message And entries like: 123, "message!" 123, "message!" 123, "different message" 124, "message!" ...
(3) odpowiedzi
2017-06-16 11:06 ROR:How to copy data in a table from one database to other table in which is in another database which has different table attributes in heroku? »
I have Products table with col_1, col_2, col_3 as attributes in one database and in another database I have products table with product_name, product_...
(1) odpowiedzi
2017-06-16 10:06 Count values for the corresponding masks in SQL »
There is a table1 with values and a table2 with masks. How to calculate (count) the number of values for the corresponding masks at the base level (SQ...
(1) odpowiedzi
2017-06-15 13:06 how to optimize a query which needs timestamp normalization »
I have the following data source, which has several physical values (one per column) coming from several devices at different times: +-----------+---...
(0) odpowiedzi
2017-06-15 12:06 FULL OUTER JOIN to merge tables with PostgreSQL »
Following this post, I still have an issue when I apply the answer given by @Vao Tsun to a bigger dataset made this time of 4 tables instead of 2 tabl...
(3) odpowiedzi
2017-06-15 10:06 Merge tables with PostgreSQL »
The title of this question is not accurate but I didn't know how to summarize it. Please feel free to write it again if you can! Here is an extract o...
(1) odpowiedzi
2017-06-15 09:06 Escape password containing @ when using postgres pg_dump command »
I 'm using postgres, I created db, user, password, this is the password: password = name&text@sob I'm using the following command to dump databa...
(2) odpowiedzi
2017-06-15 09:06 insert or update in postgresql 9.1 »
I have a bunch of insert statements with varying number of columns for their respective tables, i need to execute these queries if the record doesn't ...
(3) odpowiedzi
2017-06-14 19:06 POSTGRESQL - ERROR: could not load library pgafis.so : undefined symbol: lfsparms_V2 »
I'm using PGAFIS library for fingerprint matching. For this i have installed postgresql and having some user defined c functions. PGAFIS contain make...
(1) odpowiedzi
2017-06-14 18:06 Postgres connection taking 5 seconds to establish remotely »
I have two servers on the same network, one hosting a PostgreSQL database, and the other hosting a webserver. Connecting to the PSQL database locall...
(0) odpowiedzi
2017-06-14 15:06 postgres functions / extensions not dumped or restored correctly? »
Update Self-answered, see first comment here and my own answer. Original question I'm setting up a local development postgres db with some sql file...
(2) odpowiedzi
2017-06-14 14:06 Postgresql 9.4 - Invalid input syntax when converting to JSONB »
I've made a simple function to update a jsonb with new values: CREATE OR REPLACE FUNCTION jsonupdate( IN "pJson" jsonb, IN "pNewValues" jsonb) ...
(1) odpowiedzi
2017-06-14 08:06 pg_query like with timestamp »
I get 0 results if I query the timestamp column for entries that contain 2017 (or any other year). The data in w_presse_erscheinung is a "timestamp w...
(2) odpowiedzi
2017-06-14 06:06 JPA (@OneToMany) query without joining child table »
I'm writing a service with JPA and Postgres db. I have a class named Student: public class Student { @id private String id; private Stri...
(3) odpowiedzi
2017-06-13 23:06 How can I do less than, greater than in JSON Postgres fields? »
If I have some json: id = 1, json = {'key':95} id = 2, json = {'key':90} id = 3, json = {'key':50} Is there a way I can use Postgres fields to quer...
(2) odpowiedzi
2017-06-13 23:06 How to compare multiple column with multiple field array in Select query? »
I get stuck a bit at query creation at API server, I just want to respond with modified tracks data. I have tracks table with few columns like this. ...
(2) odpowiedzi
2017-06-13 22:06 Rails ActiveRecord_Associations_CollectionProxy with Single Table Inheritance »
I used Single Table Inheritance to model out Stores, Tailors, Orders, and TailorOrders. Orders belong to a tailor, but I am not able to access the ord...
(2) odpowiedzi
2017-06-13 20:06 problems with stackdriver monioring postgresql on a GCE »
I installed Stackdriver on a Google Compute Engine (ubuntu) and tried to configure it to monitor the postgresql service installed in that instance. T...
(1) odpowiedzi
2017-06-13 17:06 Changing postgresql start menu location »
As part of an installer that I'm working on, I need to change the default start menu location for the postgresql installation. We're packaging a postg...
(0) odpowiedzi