Data dodania Pytanie
2017-04-08 10:04 PostgreSQL doesn't use index with unaccent function »
I have the following table: CREATE TABLE products ( id bigserial NOT NULL PRIMARY KEY, name varchar(2048) -- Many other rows ); I want to m...
(1) odpowiedzi
2017-04-07 17:04 How to search through array of strings using BETWEEN in Active Record POSTGRES, »
Subscriptions canceled_at: ["2017-04-07T09:52:17-05:00", "2017-04-01T09:52:17-05:00"] Canceled_at is an array of strings. Each element is a Date...
(1) odpowiedzi
2017-04-07 16:04 Distinct values from an ARRAY column »
I'm using PostgreSQL's ARRAY to store tags for images. How can I write an ORM query in SQLAlchemy, which returns the set of all tags found in the tab...
(1) odpowiedzi
2017-04-07 14:04 Invalid status code : 0 in node.js API »
I am building a simple api in node and express with postgre as Db following a tutorial.I am still learning and new to this tech.I followed everything ...
(1) odpowiedzi
2017-04-07 09:04 Large string(40 mb) insertion in Database - logging / Performance issue »
Java version : 1.7 Database : PostgreSQL I need to insert large String in Database in multithreading application for each activity where Sting size ...
(0) odpowiedzi
2017-04-07 01:04 How to simply and efficiently query for nested relationships in SQL? »
I'm looking to write the simplest, most efficient SQL query to retrieve all of the events that are related to a given user. Setup Here's a simplis...
(3) odpowiedzi
2017-04-06 22:04 Does Rails use a single "database session" indefinitely? »
I have a use case for custom PostgreSQL prepared statements in a Rails app (apart from what ActiveRecord does automatically). My use case is to bulk ...
(1) odpowiedzi
2017-04-06 18:04 Best PostgreSQL datatype for storing key-value maps? »
I'd like to store a simple map of key-value strings as a field in my PostgreSQL table. I intend to treat the map as a whole; i.e, always select the en...
(1) odpowiedzi
2017-04-06 17:04 Create array of custom domain postgres »
Because of the inherit limitations of enum (you can't add values to the enum from within a function), I'm switching to custom domains with a check con...
(0) odpowiedzi
2017-04-06 17:04 Rails - To use polymorphism or not for performance »
I have 9 models in my applications that use a paperclip column for profile photo and cover photo. I have 2 options (at least from my limited understa...
(1) odpowiedzi
2017-04-06 14:04 dblink_build_sql_delete . I need to be able to delete the data with <= condition »
SELECT xyz.* FROM PUBLIC.DBLINK ('dbname=LiveDB port=5432 host=127.0.0.1 user=postgres password=root','SELECT dblink_build_sql_delete(''"folderstatus...
(1) odpowiedzi
2017-04-06 14:04 Postgresql's json_each()/jsonb_each() equivalent in MySQL 5.7.*? »
Is there any json_each()/jsonb_each() equivalent in MySQL 5.7.*? According to the article I found: "Not supported, cannot be implemented using UDFs o...
(0) odpowiedzi
2017-04-06 12:04 Searching for a particular value in a jsonb datatype prostgresql »
We are storing dynamic json data to a postgresql jsonb datatype field. Most of the json keys are dynamic and nested. Now I need to search one partic...
(0) odpowiedzi
2017-04-06 09:04 Tricky postgresql query optimization (distinct row aggregation with ordering) »
I have a table of events that has a very similar schema and data distribution as this artificial table that can easily be generated locally: CREATE T...
(1) odpowiedzi
2017-04-06 02:04 using .map function gives PG::GroupingError: ERROR: column "materials.id" in Rails App »
This is probably an easy one for an experienced programer, but since I´m building up on experience it seems that I'm stuck on this on... Please Help!...
(2) odpowiedzi
2017-04-05 20:04 how does ordering by UUID works on postgresql? »
Is there any ordering guarantee on using uuid_generate_v1() on postgresql? If yes, The guarantees are per machine or it does not matter on which mach...
(1) odpowiedzi
2017-04-05 18:04 Django localize datetime fields in the queryset and not template »
I'm running Django with Postgres, and have USE_TZ=True set. I want timezone-aware datetimes returned from the database, which I get from USE_TZ...
(0) odpowiedzi
2017-04-05 18:04 PostgreSQL JSON quick search (search value in from any key) »
I try to find solution for quick search functionality within PostgreSQL JSONB column. Requirements is that we can search for value in any JSON key. T...
(0) odpowiedzi
2017-04-05 17:04 Preventing duplicates while selecting into variable in MySQL »
My function generates unique combinations from Items table and stores into list variable. In the end of generation, it returns list as a result and ap...
(1) odpowiedzi
2017-04-05 16:04 Merge table results into columns (pivot/crosstab?) »
I have ~30 tables which gets "streamed" data from an external system. I'm trying to figure out how to retrieve the tables last known values for a spec...
(1) odpowiedzi
2017-04-05 11:04 PostgreSQL tagging using JSONB? »
I am implementing tagging for an image gallery. I am already using JSONB in places where I can, and I'd like to know if JSONB would be appropriate for...
(0) odpowiedzi
2017-04-05 02:04 Postgres 9.6 - Create unique index for json array »
'Sup, We have a Postgres (9.6) table myTable with a row data jsonb NOT NULL: DROP TABLE myTable; CREATE TABLE myTable (data jsonb NOT NULL); We wa...
(0) odpowiedzi
2017-04-04 19:04 SQL in AR searching if an element is not within a column array »
date = Date.today Subscription.joins(:cart).where("'#{date.beginning_of_week(:sunday).to_s}' != ANY (carts.skipped_weeks)") The column skipped_week...
(2) odpowiedzi
2017-04-04 18:04 Repeating a query which returns multiple columns over a date range in postgresql »
If I have a table like this called orders: id date value client_name 1 01/02/2017 50 Name 1 2 02/02/2017 ...
(1) odpowiedzi
2017-04-04 13:04 Running system command with argument in a PostgreSQL function »
I'm not sure if I was specific in the question, but I'm having trouble creating a Postgres function that runs a Linux shell command, with one detail: ...
(2) odpowiedzi
2017-04-04 04:04 How to model multiple table "inheritance" in Postgres? »
I'm trying to model a few different use cases that require "inheritance" in my Postgres database, and realizing there are multiple ways to do it and I...
(0) odpowiedzi
2017-04-03 17:04 Can a database exception contain the password used in the connection string? »
Can a standard database exception (ADO.NET or Entity Framework) contain the password after running .ToString() on it? I'm mostly interested in MS SQ...
(0) odpowiedzi
2017-04-03 13:04 PostgreSQL Need to make TOTAL ROW »
enter image description hereHello I'm Begginer and I need some help, I have this code in my SQL database SELECT round(SUM(Cena)::NUMERIC,2) AS Celko...
(3) odpowiedzi
2017-04-03 11:04 Query, SQL, Ruby on Rails »
I am working a project and encountered a problem regarding writing the best query for the problem. I will start presenting the problem and the soluti...
(0) odpowiedzi
2017-04-03 05:04 Add extra column in sql to show ratio with previous row »
I have a SQL table with a format like this: SELECT period_id, amount FROM table; +--------------------+ | period_id | amount | +-----------+--------+...
(2) odpowiedzi
2017-04-02 21:04 Using variables in select (apostrophes needed) »
psql (9.6.1, server 9.5.5) employees Column | Type | Modifiers ...
(1) odpowiedzi
2017-04-02 17:04 Understanding COUNT behavior in queries vs. EXPLAIN vs. functions »
I am curious to understand (and perhaps improve) an issue I am having with PostgreSQL 9.6. Names simplified but everything else is taken from a psql s...
(1) odpowiedzi
2017-04-02 14:04 Merging records in a table with 2-columns primary key »
I have prepared a simple test case for my question - In a game player ids and names are stored in the table users: CREATE TABLE users ( uid ...
(1) odpowiedzi
2017-04-02 09:04 Postgres query doesn't execute when has WITH statement »
I'm applying scenic gem for creating database view for Postgres database. I have a order (ops_orders) table with 73k records and order line item (ops_...
(0) odpowiedzi
2017-04-01 23:04 SQL model for flexible and configurable attributes »
I'd like to design an application which will eventually fuel a configurable data-driven form. Each user should be able to customize what fields appea...
(1) odpowiedzi