Questions tagged [postgresql-12]

For PostgreSQL questions specific to version 12.

PostgreSQL 12 is a major release of the PostgreSQL RDBMS.

Improvements include, but are not limited to:

  • performance improvements for partitioning and indexes
  • CTEs (WITH queries) are by default inlined for better query performance
  • JSON path queries per SQL/JSON specification
  • support for case- and accent-insensitive ICU collations
  • (stored) generated columns
  • extended statistics for “most common values”
  • page checksums can be enabled and disabled without initdb
  • authentication: support for encrypted GSSAPI authentication and LDAP server discovery
  • “pluggable storage” to add different table storage methods

More information regarding the release is available here.

554 questions
1
vote
1 answer

Get only character records from column

Table: create table tbl_prefix ( col_pre varchar ); Records: insert into tbl_prefix…
MAK
  • 6,824
  • 25
  • 74
  • 131
1
vote
0 answers

postgresql-12.service doesn't start on CentOS 8 after reboot

I have a PostgreSQL 12 database running on CentOS 8 and until today everything was good. After restarting my database server, my postgresql-12.service doesn't start anymore, I've tried with systemctl like systemctl start postgresql-12.service and I…
Henique
  • 75
  • 1
  • 8
1
vote
0 answers

Copying Data between two columns of different tables on basis of inner join in Postgresql

So I have two different schemas namely bikeshare and spatial having two tables bs and docks respectively. Also they have two common fields on basis of which i want to apply join This query works perfectly. SELECT * FROM bikeshare.bs INNER JOIN…
1
vote
1 answer

How to use the same trigger function for insert/update/delete triggers avoiding the problem with new and old objects

I am looking for an elegant solution to this situation: I have created a trigger function that updates the table supply with the sum of some detail rows, whenever a row is inserted or updated on warehouse_supplies. PostgreSQL insert or update…
coterobarros
  • 941
  • 1
  • 16
  • 25
1
vote
0 answers

PostgreSQL: pg_restore with append?

Is there some way to tell pg_restore to only append rows that don't already exist? Background: I'm trying to restore an archive-db from a main-db. Both are using PostgreSQL 12. The catch is I don't want to keep lots of the table entries on my…
Nick
  • 3,172
  • 3
  • 37
  • 49
1
vote
1 answer

Array: could not find array type for data type character varying[]

I have the following sample data for demo: Table: create table tbl_array ( array_data varchar[] ); Some values: insert into tbl_array values('{AUS,USA}'),('{IND,SA}'),('{UK,UAE,NZ}'),('{CAN,BAN,SL,KW}'); Query: I have input values {USA,AUS} or…
MAK
  • 6,824
  • 25
  • 74
  • 131
1
vote
0 answers

Error while installing postgreSQL "cluster initialisation failed"

The setup: Windows 10, postgreSQL 12.3, all the values are default. The problem: While installing postgresql 12.3 I get an error message at the end of the installation: "problem running post-install step. Installation may not complete correctly. The…
1
vote
2 answers

How to query select JsonArray from Jsonb field in Postges

I have an issue would need your help. I would like to query select data from JsonArray by id. Table (product) id(int4)| data(jsonb) | category__id Field data contain JsonArray as below { "item": [ { …
James
  • 55
  • 1
  • 6
1
vote
2 answers

Add distinct within json_agg

I have the following sample data: --EmpMap: create table EmpMap ( id int ); insert into EmpMap values(1),(2),(3); --EmpInfo: create table EmpInfo ( empid int, empname varchar ); insert into empinfo…
MAK
  • 6,824
  • 25
  • 74
  • 131
1
vote
1 answer

pg_rewind: source and target cluster are on the same timeline

I tried to synchronize between source/target clusters by using pg_rewind by the following command. And I know 100% the content of in the source/target clusters are not the same anymore. /usr/pgsql-12/bin/pg_rewind --source-server="192.168.100.100…
Cloud-Lover
  • 304
  • 4
  • 12
1
vote
1 answer

Replica between Postgres11 and Postgres12

I want to setup a replica between 2 different versions of postgres. Is it possible to setup a replica between pg11(publicator) and pg12(subcriptor)? Many thanks
1
vote
1 answer

covert number strings with leading zeros to numeric value with leading zero in postgres 12

i am new to PostgreSQL.i want to convert string '0480' to number 0480 .i am using casting operator to do this, db=# select '0480':: numeric; numeric --------- 480 (1 row) but here I am expecting 0480 number. Then i tried to_number function…
1
vote
0 answers

pg_restore from newer version to older

I am trying to restore PostgreSQL 12.2 to lower PostgreSQL 9.4.12 I encountered problem with restoring triggers using "FOR EACH ROW EXECUTE FUNCTION", since pg 12 is using EXECUTE { FUNCTION | PROCEDURE } function_name ( arguments ) while pg 9.4…
1
vote
1 answer

Postgresql 12 command line arguments initdb via Python 3 code, how to proceed?

Using Python 3.8.1 code, I unzipped the distribution of postgresql12 in a specific folder of root C, inside the code it creates two other folders, data and log. In the code I write the following line to set up a first database: subP =…
Wolverine
  • 11
  • 1
1
vote
2 answers

How to count related rows including subcategories?

I've got a few tables in a Postgres 12.3 database. The first one is named category: id|template_id|name …
Albert
  • 2,146
  • 10
  • 32
  • 54