Data dodania Pytanie
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
2017-03-04 11:03 AWS PostgreSQL RDS: more than 10GB increase in Freeable Storage Space without any data removed »
While monitoring the metrics of my Amazon PostgreSQL RDS (db.t2.small) I noticed sudden increases in the amount of Free Storage Space. This looks rath...
(1) odpowiedzi
2017-03-03 22:03 Select matching element from jsonb in Postgres »
I have the the table orders which contains a column called stores with a jsonb with many elements like id status stores 1 in progress [...
(2) odpowiedzi
2017-03-03 14:03 Does the terminology in PostgreSQL match MySQL? »
MySQL seems to use words like users and tables, whereas PostgreSQL seems to use words like users, schemas and relations. Are they equivalent? Is there...
(1) odpowiedzi
2017-03-03 13:03 Postgresql stored procedure return table all columns »
A function is created. The function has a input parameter. I can return a column but I want to return all table columns. Also I want to do if result i...
(1) odpowiedzi
2017-03-03 10:03 Different output when selecting from Postgresql database table via Perl script »
I face quite a strange situation. Via perl script i am connecting to Postgresql database and i am selecting particular columns from concrete table. Th...
(1) odpowiedzi
2017-03-03 09:03 Select single row with multiple rows in joined table »
I have a contact table as below: contactid | contactname ----------|------------- C1 | Name1 C2 | Name2 I have a communication ...
(2) odpowiedzi
2017-03-02 23:03 Port 5432 doesn't listen on Raspberry PI »
I'm trying to run postgresql 9.4 on my Raspberry PI 3, but without success. My /etc/postgresql/9.4/main/pg_hba.conf host all all 10.0.1.0...
(1) odpowiedzi
2017-03-02 22:03 My sanitizing $_POST[] function also sanitizes Turkish characters »
I've found a function on web to sanitize user input data and used it for creating an alternative to $_POST[] method as post() . However, it seems that...
(2) odpowiedzi
2017-03-02 16:03 Hibernate UUID with PostgreSQL and SQL Server »
I have an application I would like to run on both PostgreSQL and SQL Server. I would like to use java.util.UUID as the IDs. I have defined my columns...
(1) odpowiedzi
2017-03-02 16:03 How to run tests in django using database with data? »
I want to test my views using data from postgres localhost database (with already loaded data). I'm using tox with pytest and pytest-django. My quest...
(1) odpowiedzi
2017-03-02 07:03 trim the time out of the range »
I use PostgreSQL, and I'd love to trim the date if it's out of the range. First thing I'd love to filter the records out of the range. It's not diffi...
(2) odpowiedzi
2017-03-01 14:03 Array 1 contained in array 2 and elements in the same order »
Does PostgreSQL have some way for me to find if an array is contained within another array, but with the same ordering? For example, I want to know if...
(1) odpowiedzi
2017-03-01 07:03 How to use max() function to retrieve the most recent row using SQL / postgreSQL »
I have a data set that looks like this example data set. There are multiple users under one domain. I want only one row per email_domain and the row...
(3) odpowiedzi
2017-03-01 04:03 SQL - sort alphabetically for strings within a column »
I am working with postgresql and I have a table like this: Group | Name ====================================== 1 | Mary 2 | Barry,Ann,Peter 3...
(1) odpowiedzi
2017-03-01 00:03 Check that a jsonb object's keys are a subset of an allowed set »
I have a simple table with a jsonb column: CREATE TABLE products ( id serial NOT NULL PRIMARY KEY, type varchar(20) NOT NULL, details jso...
(0) odpowiedzi
2017-02-28 20:02 JDBC seems to be putting single quotes around my numbers »
I understand that best practice in SQL is to not use single quotes around numeric values to avoid having them converted to Strings. However, when I u...
(1) odpowiedzi
2017-02-28 18:02 Rails PostgeSQL jsonb collections »
I have 2 models associated with a has many financial events belonging to a single order. In the financial events model there is a jsonb column named e...
(0) odpowiedzi
2017-02-28 17:02 jsonb aggegation in postgres select queries »
Given the following table: # create table thing (id serial, tags jsonb); # \d thing Table "public.thing" Column | Type |...
(0) odpowiedzi
2017-02-28 10:02 Multiple DISTINCT ON clauses in PostgreSQL »
Is it possible to select rows that are DISTINCT ON some separate, independent sets of columns? Suppose I want all the rows which match the following ...
(2) odpowiedzi
2017-02-28 08:02 Optimizing Postgres JSONB query with not null constraint »
I've got a Postgres 9.4.4 database with 1.7 million records with the following information stored in a JSONB column called data in a table called acco...
(3) odpowiedzi
2017-02-28 01:02 converting SETOF into a string »
The function json_object_keys(json) returns a setof text. How do I transform this setof text to a string with all elements separated by a ',' ? I have...
(1) odpowiedzi