Data dodania Pytanie
2017-08-11 18:08 PSQL: Syntax error when passing set date variable into datetime »
I'm working server-side (using SSH) in psql, where I set variables using the '\set' command. My concern is this: I have a query where I'm inserting a...
(1) odpowiedzi
2017-08-11 17:08 Purge the database data with Pomm »
Doctrine provides a simple way to purge a whole database keeping the schema $purger = new ORMPurger($this->getEntityManager()); $purger->purge(...
(1) odpowiedzi
2017-08-11 15:08 postgress : SQLQuery : Week start and End date »
How to find out start and end date of week when Event Date is known. DATEADD(dd, -(DATEPART(dw, eventDate)-1), eventDate) [WeekStart] DATEADD(dd, 7...
(1) odpowiedzi
2017-08-11 11:08 How to rewrite query, which uses aggregate function and group by »
So, I have a quite large table (date-partitioned), e.g table1. There is multicolumn index on (shop_id, g_id, check_date). And I'm trying to run the q...
(1) odpowiedzi
2017-08-10 20:08 How can two DELETE queries deadlock in Postgres? »
Among the many things we do with Postgres at work, we use it as a cache for certain kinds of remote requests. Our schema is: CREATE TABLE IF NOT EXIS...
(1) odpowiedzi
2017-08-10 17:08 Preventing caching a random SQL query in Rails »
I'm trying to choose a random track but want it to avoid matching a specific record. This is my code, but it keeps returning the CACHE of the query s...
(2) odpowiedzi
2017-08-10 11:08 classoid column in pg_description »
What is the "classoid" column in pg_description table? I see it changing for different kinds of objects like table, function etc., The PostgreSQL Off...
(1) odpowiedzi
2017-08-10 07:08 Django - performance difference between join/no join existence filter »
currently I have a Tinder-like application that functions off the following models class User(models.Model): id = models.BigAutoField(primar...
(0) odpowiedzi
2017-08-09 17:08 Incrementing sequence with string prefix from foreign_key column »
This is the Cluster table: ╭────╥────────────┬─────────────╮ │ id ║ name ...
(2) odpowiedzi
2017-08-09 15:08 Postgresql data bucket based analysis »
I have a table called work which has columns as: CREATE TABLE work (user text, user_type text, medium text, docs_read int, on_date timestamp with ti...
(2) odpowiedzi
2017-08-09 10:08 recursively flatten a nested jsonb in postgres without unknown depth and unknown key fields »
How can I recursively flatten a nested jsonb in postgres which I don't know the depth and the field at each depth? (see example below) A postgressql ...
(1) odpowiedzi
2017-08-09 09:08 Django complex filter and order »
I have 4 model like this class Site(models.Model): name = models.CharField(max_length=200) def get_lowest_price(self, mm_date): '''T...
(4) odpowiedzi
2017-08-09 04:08 rspec active record testing error on serialize »
i'am using rspec to testing my model that should serialize a json. btw this is show an error in my console this is my rspec require 'rails_helper' R...
(1) odpowiedzi
2017-08-08 22:08 Using dynamic schema with postgres »
I have to decide how I want to implement dynamic schema. I will try to put some more description where my problem is. I use the postgres DB in lates...
(0) odpowiedzi
2017-08-08 21:08 How to get date: one month away from a specific date? »
I know that I can get the date from today such as select CURRENT_DATE - INTERVAL '1 months'; But what if I need the first date specified. Somet...
(2) odpowiedzi
2017-08-08 14:08 Combining SQL queries with shared logic »
I'm currently duplicating a rather large SQL aggregation query so that I can run it once to return the metrics for the entire data set, then again to ...
(2) odpowiedzi
2017-08-08 14:08 PostgreSQL Full Text Search Spanish character Ñ »
I am facing an issue when doing full text search with PostgreSQL on text that contains de Spanish character 'Ñ' When I try to tokenize the Spanish w...
(1) odpowiedzi
2017-08-08 10:08 How to select data from jsonb column? »
I have got one column with type jsonb. The data in this column looks as below { "random_number1": { "random_number2": { ...
(1) odpowiedzi
2017-08-07 17:08 Email confirmation in Flask fails »
The below code successfully generates a token and sends a link to the user's inbox for confirmation. But when the user clicks on it, Flask is not reco...
(1) odpowiedzi
2017-08-07 10:08 Sanitize user input with the USING keyword in PL/pgSQL »
This is how I create my search_term: IF char_length(search_term) > 0 THEN order_by := 'ts_rank_cd(textsearchable_index_col, to_tsquery...
(1) odpowiedzi
2017-08-07 07:08 Could not create target cluster during upgrade 9.5 to 9.6 »
I am on ubuntu 16.04, and install postgres 9.5 on it Then I to upgrade postgres 9.5 to 9.6, and I following postgresql offical download page to insta...
(0) odpowiedzi
2017-08-06 21:08 Postgres partitioning options right now? »
I have a task which would really benefit from implementing partitioned tables, but I am torn because Postgres 10 will be coming out relatively soon. ...
(1) odpowiedzi
2017-08-06 20:08 Redshift: Update or Insert each row in column with random data from another table »
update testdata.dataset1 set abcd = (select abc from dataset2 order by random() limit 1 ...
(1) odpowiedzi
2017-08-06 20:08 Unable to deploy rails app on Heroku. Postgresql not detected »
I have developed a rails app Todo List but when trying to deploy it on Heroku. I see the database needs to be changed to PostgreSQL. I tried with foll...
(0) odpowiedzi
2017-08-06 15:08 Database options available for storing 100GB of Key value pair kind data »
I am currently using SQL Server to store this data ,its normalized and indexed but performance is still poor if i perform some where operation on nume...
(2) odpowiedzi
2017-08-05 15:08 Trigger behaving strangely »
I'm making a Database that needs to store data for a school system and for certain activities minors need a permit. I have this trigger that checks th...
(1) odpowiedzi
2017-08-05 06:08 unable to get defination of an index psypg2 »
i need to recreate indexes on a table as i have to insert a lot of data into the table. i am trying to get the defination of an index in postgres usin...
(1) odpowiedzi
2017-08-05 04:08 SQL issue - type of fkey »
I'm using PostgreSQL What I need In SELECT query I need to select owner_type (client or domain). If solution does not exist please help me to rework...
(2) odpowiedzi
2017-08-05 00:08 Query for exact match of jsonb column in Rails 5 and PostgreSQL »
In my Rails 5 app with a Postgres database, I have a model Post with jsonb column called comments. The default value for comments is {}. I would lik...
(1) odpowiedzi
2017-08-04 20:08 Access a JSONB array of objects as an object of arrays »
I have a JSONB column in my Postgres 9.6 database with roughly the following structure [ { "A": "some value", "B": "another value", "fo...
(1) odpowiedzi
2017-08-04 18:08 Django won't use postgres schema properly »
I have a problem with using schema while running tests with django. All tables in my postgres database are in schema, let's name it 'schema'. In my se...
(0) odpowiedzi
2017-08-04 17:08 Populate random data from another table »
update dataset1.test set column4 = (select column1 from dataset2 order by random() limit 1 ...
(1) odpowiedzi
2017-08-04 05:08 How to select rows covering today's day and month in pg / Rails »
So I have this table called SeasonRate create_table "season_rates", force: :cascade do |t| t.string "title" t.datetime "from_date" t.datetime...
(1) odpowiedzi
2017-08-03 20:08 Rails/Postgres query all records created after 5 PM in taking into account daylight savings switch? »
I am looking to query for all records on a table with a created_at time of after 5 PM, EST WITH taking into account daylight savings. My DB is Postgr...
(2) odpowiedzi
2017-08-03 18:08 Why am I having this database issue? »
I am working on a Python/Django project, and we need to use two databases. Following the documentation I added a second database like this: DATABASE_...
(2) odpowiedzi