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
0
votes
3 answers
Is there any way to optimize this SQL?
I have the following SQL statement:
SELECT DISTINCT e.eventid,
e.objectid,
e.clock,
e.ns,
e.name,
e.severity
FROM events e,
functions f,
items i,
…

Umut TEKİN
- 856
- 1
- 9
- 19
0
votes
1 answer
Postgres Select count(*) taking many minutes
I am running select count() against large table in postgresql, over 10 billion rows. The count() query is taking over 25 minutes to return. Slow is one thing, but that extraordinary and leads to to think there is something wrong within DB, table, ?…

2down2
- 1
- 4
0
votes
1 answer
Error while running the postgresql command line tools after installation in macos?
I have installed PostgreSQL 13 in my mac using the edb installer with all the tools as per the installation guide now when I am trying to run the command for it in terminal /Library/PostgreSQL/15/bin/psql -U postgres I get an error stating
psql:…

Muhammad Sarmad
- 118
- 4
0
votes
1 answer
Postgres global .conf file
I manually built postgresql-13.11 on an m1 mac.
When attempting to run either /path/to/postgres/bin/postgres (same for postmaster), i get the following error:
postgres does not know where to find the server configuration file.
You must specify the…

YosefAhab
- 64
- 10
0
votes
1 answer
Postgresql 13 - Combine the data from n number of tables into final result
I have to combine data from 2 tables into a final result which will include columns from both tables. Both tables have 1 common column but its value may/may not have the same value.
So if a value from that common column exists in both tables then…

Vikas J
- 795
- 3
- 14
- 31
0
votes
0 answers
I want to upgrade postgresql from 13.4 to 13.11 version to clear vulnerability?
there is a medium vulnerability on the vm and want to upgrade the minor version to the latest so the va will get cleared, and there is no internet on vm how i can upgrade the version from 13.4 to 13.11?

sandesh Jadhav
- 139
- 1
- 1
- 6
0
votes
0 answers
Error: initdb failed | PostgreSQL Update from 13.6 to 15.3
I want to update my postgresql13.6 to latest one (15.3 for now).
Steps I followed :
I'm using AWS, I create Image from the instance[ ubuntu ] (runs postgresql 13.6)
From AMIs, I launch a new instance
Postgresql 13.6 is working fine
I used the…

kumardippu
- 599
- 4
- 11
0
votes
1 answer
Timescale DB Create distributed hypertable
I want to create a PoC of a distributed hypertable, using TimescaleDB and docker compose.
I've set up a docker compose with two instances and created the respective table in both instances.
Let's say instance A is the access node (main node)
Before…

J2R
- 148
- 2
- 11
0
votes
0 answers
pghero relying on old postgres package
I am trying to install pghero and came across a package that doesn't exist in the pgdg repo anymore:
# yum install pghero
Last metadata expiration check: 0:08:39 ago on Wed 19 Apr 2023 03:09:19 PM UTC.
Error:
Problem: cannot install the best…
0
votes
1 answer
Why is postgres update not limited to the rows in the cte
This is PostgreSQL 13.10...
This question is about using UPDATE with a CTE on a VIEW (though I tried eliminating the VIEW and still have the same issue).
I am using a REST API frontend that generates SQL queries for CSV updates using a template…

user9645
- 6,286
- 6
- 29
- 43
0
votes
0 answers
Postgres: How to check if a JSONB object exists in the database?
I've got a script that uploads data to a Postgres database. I've now got a requirement where I need to make sure I'm not uploading duplicate data. The field I need to check against is a jsonb one. I can't make the check on another field.
I've seen a…

Omar Siddiqui
- 1,625
- 5
- 18
0
votes
1 answer
UPDATE doesn't update all the rows
I'm making an UPDATE that should update as many rows as the SELECT query returns.
UPDATE items
SET quantity = items.quantity - (subquery.order_quantity * subquery.join_quantity)
FROM (
SELECT x.id_recipe as id_recipe,
x.quantity as…
0
votes
1 answer
The data directory was initialized by PostgreSQL version 12, which is not compatible with this version 13.10
I am trying to run postgres:13-alpine in Kubernetes cluster.
I have next Kubernetes manifest
PV
kind: PersistentVolume
apiVersion: v1
metadata:
name: open-imis-pv-volume
labels:
type: local
app: postgres
spec:
storageClassName: manual
…

dos4dev
- 429
- 2
- 10
- 26
0
votes
2 answers
Efficient way to check if ID of foreign key is still referenced?
Context: I have this table called product and I am writing a script to clean up some old products, but have to follow rules, which can be deleted. One of the rules, is to only delete it if its not referenced by some other specific tables.
So…

Andrius
- 19,658
- 37
- 143
- 243
0
votes
1 answer
How to call function with a custom type array as its parameter from the SQL editor
I have create a custom type like this:
CREATE TYPE my_schema.sample_type
AS
(
id int,
categories int[],
body text
);
This type is used as the array parameter in my function:
CREATE OR REPLACE FUNCTION my_schema.bulk_operation(
…

juliano.net
- 7,982
- 13
- 70
- 164