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

PostgresSQL could not load library plpython3.dll

I managed to install the plpython3u extention. But when I try to use a function that uses the extension I get: ERROR: could not load library "C:/Program Files/PostgreSQL/12/lib/plpython3.dll": unknown error 126 SQL state: 58P01 I'm using windows…
1
vote
2 answers

Azure DevOps for Azure PostgreSQL

I did some research and found that Azure DevOps does have any outofthebox implementations to support CI CD for Azure PostgreSQL. Does anyone , have any idea , How can we configure Azure DevOps for PaaS offering of Azure PostgreSQL Database Please…
MSTechnie
  • 175
  • 10
1
vote
1 answer

Bad query plan for small dataset makes it very slow

Question My query (simple with a few joins) runs extremely slow when I have a small amount of data (~50k rows) but runs fast when I have a bigger amount of data (~180k rows). The time difference is huge since it is from a few seconds to almost half…
Jzbach
  • 346
  • 3
  • 17
1
vote
1 answer

A bug in PostgreSQL suppress_redundant_updates_trigger?

I was working on a set of triggers in PostgreSQL and I think I stumbled on a bug on the built-in function/trigger suppress_redundant_updates_trigger(). It's fully reproducible on my configuration (PostgreSQL 12 on my laptop). First I set up a table,…
1
vote
1 answer

How to index a multilanguage entity in PostgreSQL

Here I am creating table product_feature_text, having a 1:N relation with table product. As the application must support several user languages, a lang_code column is added to segment english texts from other language texts. As I want to present the…
1
vote
1 answer

Will adding new generated column lock table in PostgreSQL 12

It is not clear from PostgreSQL documentation: will adding new generated column lock table? I have big table in my PostgreSQL 12 installation and I need to execute SQL-patch: ALTER TABLE abc ADD COLUMN gen TEXT GENERATED AS ALWAYS (...) STORED; So,…
1
vote
2 answers

PosgtreSQL procedure

I am new to postgres function. My requirement is to run a function on each and every table present in particular schema in postgres database but I am facing a problem because the function is returning only a single record each time the function…
A gupta
  • 39
  • 5
1
vote
1 answer

How to refer to the selected rows in an `insert select on conflict update` sentence in PostgreSQL

This is a simple function moving supply stocks from one warehouse to another one. It upserts all the source stock into the destination warehouse and then removes the stock from the source warehouse. This might be a silly syntax error but I am…
coterobarros
  • 941
  • 1
  • 16
  • 25
1
vote
1 answer

Are custom domains arrays possible in PostgreSQL 12?

I have declared a custom domain tmoney as create domain tmoney as decimal (13,4); Then I use an array of it in a table declaration, create table test ( id int generated by default as identity primary key, volume smallint[5] not null…
coterobarros
  • 941
  • 1
  • 16
  • 25
1
vote
1 answer

Postgres pg_upgrade corrupt indexes (UK) missing values though missing records by index based selects

After 9.6->12.3 pg_upgrade we marked some serious select give missing results! REINDEX or drop / create healthed the problem. Upgrade bulletpoints Stop 9.6 rsync 9.6 data and bin files from Centos7 to Centos8 (pre installed…
László Tóth
  • 483
  • 5
  • 15
1
vote
2 answers

Printing different language characters in psql

I want to store multiple languages at the same column. First i'm creating db and tables. CREATE DATABASE dbname ENCODING 'UTF8' I'm saving the data succesfully, but when i want to print it with a SELECT query, i get this error using psql. ERROR: …
1
vote
1 answer

Get databases from old PostgreSQL folder (win 10)

I need to get databases from the old PostgreSQL folder that was in Program Files (win 10). I tried changing the data path through the registry (ImagePath value after "-D" at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\postgresql-x64-12)…
Dmitriy
  • 49
  • 1
  • 6
1
vote
1 answer

Auto updated column and generated always values

Usually if I need to have some auto updated column as updated_at I used function and trigger. For example as it is described here. In Postgres 12 we got generated columns. It does not give ability to use now() function directly, however I could…
1
vote
1 answer

Querying against an inner field in postgresql jsonb column

I have a jsonb column, which has a structure like this: { .....other fields, "a" : { "b" : { "c" : "some value", ....other fields } .....other fields }, ...other fields } I can have…
Mandroid
  • 6,200
  • 12
  • 64
  • 134
1
vote
0 answers

Rolling totals with materialized view. A way to reduce refresh time

There is a table create table container_operations ( id uuid not null primary key, plant_id uuid not null, container_id uuid not null, contragent_id uuid, quantity integer not null, created_at timestamp not null ) And there…
whsv26
  • 63
  • 1
  • 6