postgresql-9.5 Questions

6

I'm getting the following error when doing the following type of insert: Query: INSERT INTO accounts (type, person_id) VALUES ('PersonAccount', 1) ON CONFLICT (type, person_id) WHERE type = 'Pers...
Topheavy asked 3/2, 2017 at 10:43

2

Solved

I'm writing a prototype of a full-text search feature which will return found documents' "headlines" in the search result. Here's a slightly modified example from the Postgres docs: SELECT ts_head...
Speaking asked 26/10, 2016 at 13:43

8

Solved

I'm working through the Postgres DVD tutorial and am running into issues importing their sample database. Running pg_restore -U postgres -d dvdrental ~[filepath]/dvd-database.tar.gz gives me pg_re...
Denysedenzil asked 6/2, 2016 at 21:33

7

Solved

With PostgreSQL(v9.5), the JSONB formats give awesome opportunities. But now I'm stuck with what seems like a relatively simple operation; compare two jsonb objects; see what is different or missi...
Birch asked 16/3, 2016 at 16:41

2

Solved

When you are upserting a row (PostgreSQL >= 9.5), and you want the possible INSERT to be exactly the same as the possible UPDATE, you can write it like this: INSERT INTO tablename (id, username, p...
Oulu asked 1/4, 2016 at 14:52

7

Solved

postgres:9.5 I try rebooting, docker-compose build --no-cache delete image and container and build again I have many proyects and anybody starts, keeps the same configuration... Mac osx Sierr...
Celiotomy asked 11/4, 2017 at 19:36

4

Solved

For versions less than 9.5 see this question I have created a table in PostgreSQL using this: CREATE TEMP TABLE jsontesting AS SELECT id, jsondata::jsonb FROM ( VALUES (1, '["abra","value","man...
Whitewash asked 14/2, 2017 at 18:23

4

Solved

I am using knex js and postgresql database. I have used a migration file to create a table knex migrate:make create_car_table. In this I have added a column fuel_type. table.enu('fuel_type', ['PETR...
Schwarz asked 25/7, 2017 at 9:39

2

Solved

In Postgres, is there a need to lock a row in a table using FOR UPDATE if the query is contained in a transaction with serializable isolation level? In other words, does serializable transaction lo...
Philous asked 16/3, 2023 at 19:55

2

Solved

I made daily backups of a postgresql DB using the command /usr/bin/pg_basebackup -D $outdir -Ft -x -z -w -R -v Now I want to restore this DB on another server. I used the description on https://...
Feltie asked 15/6, 2018 at 13:4

3

Solved

correct syntax of upsert with postgresql 9.5, below query shows column reference "gallery_id" is ambiguous error , why? var dbQuery = `INSERT INTO category_gallery ( category_id, gallery_id, crea...
Embowel asked 22/4, 2016 at 16:35

2

Solved

create schema bla; -- then create table table_name into this schema Then I want change default schema for user (user is postgres) I do: ALTER ROLE postgres SET search_path TO bla; (Query return...
Overlooker asked 8/6, 2017 at 7:22

2

Solved

I know you can get the average, total, min, and max over a subset of the data using a window function. But is it possible to get, say, the median, or the 25th percentile instead of the average with...
Utoaztecan asked 25/9, 2016 at 4:20

25

Solved

Whenever I try to drop database I get the following error: ERROR: database "pilot" is being accessed by other users DETAIL: There is 1 other session using the database. When I use: SELEC...
Reflection asked 3/7, 2013 at 13:32

3

Solved

In PostgreSQL 9.5, is there a way to rename an attribute in a jsonb field? For example: { "nme" : "test" } should be renamed to { "name" : "test"}
Belfort asked 17/2, 2017 at 22:53

3

Solved

Most of the examples I see are people inserting a single row into a database with the ON CONFLICT DO UPDATE syntax. Does anyone have any examples using SQLAlchemy or pandas.to_sql? 99% of my inse...
Chilung asked 9/3, 2017 at 12:26

3

Solved

I need strict control of the reading and writing of my Postgres data. Updatable views have always provided very good, strict, control of the reading of my data and allows me to add valuable compute...
Aguila asked 22/11, 2015 at 17:48

4

Solved

Postgres shuts down immediately when started with docker-compose. The yaml file used is below version: '2' services: postgres: image: postgres:9.5 container_name: local-postgres9.5 ports: -...
Stemson asked 16/5, 2016 at 17:18

2

Solved

I am trying to start a postgresql docker container which is of version 10.5. But before that I have used 9.6 version in the same docker-compose.yml file and there is no data populated in the datab...
Jaclynjaco asked 27/9, 2019 at 21:12

3

Solved

I was helping with this question trying to change the format for the interval. from '01 day 22:10:37' to '46:10:37' I give a solution with string manipulation. But then I found postgres can show...
Langill asked 29/6, 2016 at 18:58

5

I am new to pgAdmin 4. I have forgot to setup of login Email id and password while install pgAdmin 4. How can I change after installation? Any one can help me?
Laryngeal asked 22/10, 2019 at 4:16

3

Solved

I need obtain table names from schema, except some tables CREATE OR REPLACE FUNCTION func(unnecessary_tables TEXT) returns void as $$ begin EXECUTE 'SELECT table_name FROM information_schema.tabl...
Ran asked 1/12, 2015 at 12:59

2

Solved

I want to create a trigger which counts rows and updates a field in an other table. My current solution works for INSERT statements but failes when I DELETE a row. My current function: CREATE OR R...
Larisalarissa asked 21/6, 2018 at 7:24

3

I am beginner both of docker and postgresql.  How do I upgrade docker postgresql 9.5 into 9.6 without losing my  current database?  fyi: im using ubuntu version 14 and docker 17.09  Thanks in advan...
Bronchiole asked 10/10, 2017 at 17:29

1

I am trying to restore the backup of the database but it's giving me the error of roles, so I got to know that first, we have to take backup of roles/users then we take complete backup but I am una...
Ammeter asked 9/9, 2021 at 11:40

© 2022 - 2024 — McMap. All rights reserved.