Questions tagged [postgresql-10]

for PostgreSQL questions specific to version 10

On 5 October 2017, PostgreSQL 10.0 was released. Major enhancements in PostgreSQL 10 include:

  • Logical replication using publish/subscribe
  • Declarative table partitioning
  • Improved query parallelism
  • Significant general performance improvements
  • Stronger password authentication based on SCRAM-SHA-256
  • Improved monitoring and control

Note that as of version 10, PostgreSQL has moved from 3 component version ids to 2 components, so 10.1 is a minor release.

The official documentation for this version is available at: http://www.postgresql.org/docs/10/static/index.html

632 questions
3
votes
1 answer

PostgreSQL10 - is it possible to do PARTITION BY LIST (col1, col2, .., colN)?

I am looking at the PostgreSQL official documentation page on Table Partitioning for my version of postgres. I would like to create table partitions over three columns, and I wish to use declarative partition with BY LIST method to do that. However,…
umbe1987
  • 2,894
  • 6
  • 35
  • 63
3
votes
1 answer

Insert element in JSONB Array - Postgresql

Let's say I have a table: SELECT * FROM settings; | id | name | strategies | | -- | --- | --- | | 1 | default | [{name: xyz, enabled: true}, {name: bot2, enabled: true}] | | 2 | new1 | [{name: bot2, enabled: true}, {name: xyz,…
van_folmert
  • 4,257
  • 10
  • 44
  • 89
3
votes
0 answers

Postgresql : syntax error at or near "(" when adding a column

I've been trying to add stored generated column with this command ALTER TABLE mtn_order ADD COLUMN textsearchable_index_col tsvector GENERATED ALWAYS AS (to_tsvector('english', coalesce(descr, '') || ' ' || coalesce(descrrep, ''))) STORED; But I…
Viktor
  • 325
  • 2
  • 10
3
votes
0 answers

Unable to start Strapi on MacOS PostgreSQL

System - Node.js version: v10.19.0 - NPM version: 6.13.4 - Strapi version: 3.0.0-Beta.2 - Database: PostgreSQL 10.11 - Operating system: MacOS Catalina Describe the bug I am trying to run local Strapi on my Mac. npm run build works well. However,…
3
votes
1 answer

Merging an array of JSON objects to one JSON column in Postgres

I have two tables, products and products_ext that can be reduced essentially to this basic form: CREATE TABLE "products" ( "product_id" TEXT PRIMARY KEY ); CREATE TABLE "products_ext" ( "product_id" TEXT NOT NULL, "key" TEXT NOT NULL, …
adrenalin
  • 1,656
  • 1
  • 15
  • 25
3
votes
1 answer

pg_upgradecluster taking too much time(around 8 hours for 165GB database) any workarounds?

I am trying upgrade postgres-9.3 to postgres-10 with database size around 165GB. I am using "sudo pg_upgradecluster 9.3 main" to do so but it's taking around 8hours which is way too much downtime for my live webapp. Any suggestions to make it better…
3
votes
1 answer

Sequence data and logical replication

From my understanding logical replication in Postgres does not replicate sequence data. Let's assume we have two multi-master postgres servers server1 test_table current sequence 100 server2 test_table current sequence 90 If server1 goes down and…
Arya
  • 8,473
  • 27
  • 105
  • 175
3
votes
2 answers

How do I improve date-based query performance on a large table?

This is related to 2 other questions I posted (sounds like I should post this as a new question) - the feedback helped, but I think the same issue will come back the next time I need to insert data. Things were running slowly still which forced me…
dgwebb
  • 321
  • 3
  • 16
3
votes
3 answers

AWS RDS Postgres maximum instance and table size

Thanks in advance! I am planning to use AWS RDS Postgres for pretty big data (> ~50TB) , but I have couple of questions un-answered Is 16TB the maximum limit for AWS RDS Postgres instance, if so how do people store > 16TB data. Is the limit of 16TB…
user1393608
  • 1,299
  • 3
  • 16
  • 29
3
votes
2 answers

Cannot access foreign table using Postgres FDW

I had a foreign table set up in Postgres 10. The role "role1" has been granted usage on the foreign server (fs) that was set up using the postgres superuser. I imported the table using the import schema command: IMPORT FOREIGN SCHEMA f_schema LIMIT…
3
votes
1 answer

PostgreSQL Negative Integer Overflow

I was doing some tests on Postgres using the tinyint extension when I came across something surprising regarding its range. On typing select -128::tinyint it gave me an ERROR: tinyint out of range message which was not what I was expecting at…
Lucas
  • 600
  • 3
  • 9
3
votes
1 answer

The type initializer for 'Npgsql.PoolManager' threw an exception

Getting this exception "The type initializer for 'Npgsql.PoolManager' threw an exception." only on window 7. public string ValidateDefaultInstancePostgreSqlServer() { string found = "0"; try { using…
Learner
  • 81
  • 1
  • 7
3
votes
1 answer

Python psycopg2 executing select pg_notify doesn't work

This is my very first question at StackOverflow so if i am doing something wrong please be gentle. I'm struggling with executing SELECT pg_notify from Python script. It seems that it doesn't work at all. My NodeJS server is listening 'testnotify'…
Paabo
  • 41
  • 5
3
votes
2 answers

How to clamp a float in PostgreSQL

I have a number 1.00000001, and I want to clamp it between -1 and 1 to avoid input out of range error on ACOS() function. An MCVE look like this: SELECT ACOS( 1 + 0.0000000001 ); My ideal would be something like: SELECT ACOS( CLAMP(1 +…
Ulysse BN
  • 10,116
  • 7
  • 54
  • 82
3
votes
1 answer

Use COPY FROM command in PostgreSQL to insert in multiple tables

I'm trying to use the performance of COPY FROM command in PostgreSQL to get all data of 1 table of a CSV file (CSV -> table1) and I need to insert other data, but, in a new table. I will need of a primary key of first table to put as a foreign key…