Use this tag to indicate that your question is about PostgreSQL version 13. Questions concerning database administration should go to https://dba.stackexchange.com/
Questions tagged [postgresql-13]
368 questions
5
votes
2 answers
Are hash indexes the most optimal for exact text match queries as of Postgres 13?
Example (fake) case: indexing a column containing e-mails (text type) when the column will exclusively be queried for an exact string match, ex.
SELECT * FROM mytable WHERE email = 'test@test.com'
Do hash indexes provide advantages over B-TREEs…

Z. M.
- 329
- 5
- 13
5
votes
0 answers
Cannot find "$libdir/postgis-3" in PostGIS Docker image itself
It sounds like PostGIS itself cannot be found in... the PostGIS Docker image. Therefore, I guess I must be wrong somewhere but I cannot figure it out. Here's the error I face each time I build and start a container based on the Dockerfile…

swiss_knight
- 5,787
- 8
- 50
- 92
4
votes
2 answers
How to fix PostgreSQL generic plan estimate for any($1) array parameter?
I've run into an issue where PostgreSQL (13.1 on windows, default config) would start preferring a generic plan after 5 executions because the plan estimate is clearly wrong. Thing is, the custom plan is up to 10 times faster than the generic plan,…

griffin
- 1,261
- 8
- 24
4
votes
1 answer
Is it possible for an owner to not have table-privileges?
We have been trying to create many roles and users in one of the databases. At one point I came across this issue that I am finding it hard to reproduce.
It is reproducible within the database but when I create a new database and try the same it…

Surya
- 2,429
- 1
- 21
- 42
4
votes
2 answers
Efficient full text search in PostgreSQL, sorting on another column
In PostgreSQL, how can one efficiently do a full text search on one column, sorting on another column?
Say I have a table tbl with columns a, b, c, ... and many (> a million) rows. I want to do a full text search on column a and sort the results by…

jake n
- 342
- 3
- 15
4
votes
2 answers
Building postgres from source throws "'utils/errcodes.h' file not found" when called from other makefile
I am currently constructing a Makefile and one of the things it will be doing is downloading and building postgres from source. Before starting to write the makefile file I always used the following set of commands to do this:
curl -LJ…

Mercury
- 594
- 1
- 12
- 28
4
votes
1 answer
Replication lag - exceeding max_slot_wal_keep_size, WAL segments not removed
Summary
We are using max_slot_wal_keep_size from Postgresql 13 to prevent master from being killed by a lagging replication. It seems, that in our case, WAL storage wasn't freed up after exceeding this parameter which resulted in a replication…

Marcin Krupowicz
- 536
- 6
- 16
4
votes
2 answers
Can i refer FOREIGN KEY to partitioned table in Postgresql v13?
Im trying to add foreign key between 2 partitioned table and it gives me error (there is no unique constraint matching given keys for referenced table "user")
im using postgresql v13, pgAdmin 4.26.
partitioned table to normal table foreign key…

Orgil
- 81
- 2
- 4
3
votes
2 answers
AWS EC2 Amazon Linux 2 AMI Starting PostgreSQL
Have an AWS EC2 instance which is running Amazon Linux AMI 2.
Installed PostgreSQL using
sudo amazon-linux-extras install postgresql13
Now, how to start it and configure it?
I can see
Package postgresql-13.3-2.amzn2.0.1.aarch64 already…

CR Sardar
- 921
- 2
- 17
- 32
3
votes
3 answers
How to JOIN tables without extra duplicates in multiple one-to-many relationship
I have two child tables with a one-to-many relationship to the parent table. I want to join them without extra duplication.
In the actual schema, there are more one-to-many relationships to this parent and to child tables. I'm sharing a simplified…

Ulvi
- 965
- 12
- 31
3
votes
1 answer
Convert jsonb column to a user-defined type
I'm trying to convert each row in a jsonb column to a type that I've defined, and I can't quite seem to get there.
I have an app that scrapes articles from The Guardian Open Platform and dumps the responses (as jsonb) in an ingestion table, into a…

Oscar Barlow
- 100
- 7
3
votes
0 answers
PHP postgres failover
I'm running PHP web app that uses PDO to connect to postgres (https://github.com/fusionpbx/fusionpbx/blob/bc1e163c898ea2e410787f8e938ccbead172aa5a/resources/classes/database.php#L202).
I'm running a failover cluster and so basically I just put 2…

Łukasz Zwierko
- 621
- 7
- 15
3
votes
1 answer
How to move location of postrgresql 13 database
I am looking to move the location of a pgsql 13 database from it's default to another disk.
I initially followed this guide link
But this is for v9.5, not 13. My challenge is that the location of the database - found from running the below command -…

fraserc182
- 237
- 1
- 4
- 13
3
votes
3 answers
PostGIS extension not installing
hello i was trying to install postgis to one of my database with the following command
CREATE EXTENSION postgis;
but it returned an error of
ERROR:
could not open extension control file…

aarush_s
- 91
- 1
- 1
- 7
3
votes
0 answers
Postgresql not getting installed on ubuntu 20
I have recently upgraded my ubuntu to 20.04. Now, I am trying to install the postgresql but I am getting error. I have tried to 100 different ways and crawled every web but nothing worked.
These are the steps I followed:
Step 1
sudo apt…

Shahid Tariq
- 886
- 6
- 19