Questions tagged [postgresql]

PostgreSQL, often simply Postgres, is an object-relational database management system (ORDBMS) available for many platforms including Linux, FreeBSD, Solaris, Microsoft Windows and Mac OS X.

Filter by
Sorted by
Tagged with
0 votes
1 answer
27 views

Unix-domain Socket

I'm trying to set my server up and came across some troubles related to Unix domain sockets. I don't have so much experience with Unix, despite the stack for web development: Apache, PHP and SQL. I ...
user avatar
0 votes
1 answer
26 views

Can I pipe live data from the \watch command of postgresql into another command?

I'd like to pipe live data from psql into another command for purposes of monitoring via the shell. Can this be done? So far I have the following: $ psql bareos -c '\watch (SELECT * FROM log ORDER BY ...
user avatar
  • 4,039
0 votes
0 answers
12 views

Commands after the snap enable docker command is erroring out in script file

I have a script file as follows. #!/bin/sh sudo snap enable docker sudo docker image ls sudo docker ps -a sudo docker start postgresql-dev sudo docker start dev-pgadmin psql -h 172.17.0.2 -U ...
user avatar
0 votes
1 answer
43 views

Slackware and postgres

I want to install postgres and psql via a Slackbuild and I did so. After installing it I tried running the command as suggested in the readme of the Slackbuild but I get an error upon running it as ...
user avatar
0 votes
1 answer
54 views

Debian - Schedule a SQL query with crontab

I wan't to schedule a SQL query in a PostgreSQL database with a crontab. In terminal, in root, when I run: psql -U postgres -d my_database -h localhost -p 5432 -c "INSERT INTO schema.table (name) ...
user avatar
  • 109
0 votes
1 answer
63 views

How can I change the PostgreSQL data folder to a shared folder location while using VirtualBox?

I'm following this tutorial that explains how to move a PostgreSQL data folder location. Basically, I just need to copy the files inside /var/lib/postgresql to a different location... Something like: ...
user avatar
  • 319
0 votes
0 answers
205 views

Can't connect to Postgres through Docker

I have created a container with the following Postgres db but when I try to connect to it using pgcli I get this error. I tried everything such as restarting Postgres service, different users/...
user avatar
0 votes
0 answers
51 views

Postgresql issue on Manjaro 21.2.1

It was working just fine a couple of months ago, but now it just returns the following, any ideas why libldap-2.4.so.2 could not be found all of the sudden? OS: Manjaro 21.2.1 ~ postgres --version ...
user avatar
  • 1
0 votes
1 answer
147 views

ufw won't allow connections to postgres port 5432

With ufw disable on remote postgres system i'm able to connect from my local system However, the connection does not work when I ufw enable as shown below: C:\Users\HOME>telnet 80.240.24.195 5432 ...
user avatar
  • 297
0 votes
1 answer
48 views

how to execute a command in a running command in bash

how to execute this commands in bash script #!/bin/bash docker exec -ti test psql db db drop schema if exists stack cascade; delete from partman.part_config; \q pwd cd /folder/name
user avatar
  • 3
-1 votes
2 answers
51 views

what is the version relationship about postgresql-devel and postgresql

Are the postgresql-devel version have a relationship with postgresql? is it have a version matrix? if I installed postgresql 13, how to install the postgresql 13 mapped postgresql-devel version in the ...
user avatar
  • 351
0 votes
1 answer
586 views

E: Unable to locate package postgresql-server-dev-10 in Ubuntu 18.04

I am writing a Django app with postgresql, using Docker. However, for some reason building returns the error "E: Unable to locate package postgresql-server-dev-10 The command '/bin/sh -c apt-get ...
user avatar
0 votes
0 answers
95 views

Warnings Resource is promotable but has not been promoted on any node

when i configuring cluster i get warning: Resource is promotable but has not been promoted on any node My conf. pcs resource create pgsqld ocf:heartbeat:pgsqlms \ op start timeout=60s ...
user avatar
0 votes
0 answers
211 views

npm install failling at node-gyp rebuild and libpq

> libpq@1.8.9 install /home/johnsoct/bobtail/node_modules/libpq > node-gyp rebuild /home/johnsoct/.nvm/versions/node/v12.22.4/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin/node-...
user avatar
3 votes
3 answers
2k views

How to deal with www.postgres.org certificate expired?

I've started getting errors when getting certificate keys from the postgres website: wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - #6 0.310 --2021-10-04 20:56:35-...
user avatar
0 votes
0 answers
294 views

Connecting to postgresql docker (Cannot connect from host)

Previously it was ok/works normally, but suddenly it didn't work, these docker spawned using library github.com/ory/dockertest with port 49157/tcp forwarded to 5432: docker ps CONTAINER ID IMAGE ...
user avatar
  • 7,981
1 vote
0 answers
32 views

Recovering ext4 superblock error

Server crashed due to huge posgresql ram usage. After restart, the disk which located postgresql data did not mount due to superblock error. I created new volume from aws console for restoring that ...
user avatar
0 votes
0 answers
47 views

High CPU usage of postgresql

I have a PostgreSQL backed complex Ruby on Rails application running on a Ubuntu Virtual Machine. I see that the Postgres processes were having very high CPU usage while running top command. ...
user avatar
0 votes
0 answers
20 views

How to confirm that I installed on correct EBS volume

I am relatively new to Unix. This problem is about Ubuntu Ec2 instance I am using to install Postgres. The fact is, I installed everything related to postgres, configured services and logging and all, ...
user avatar
-7 votes
2 answers
3k views

"Data directory /var/lib/postgresql/13/main must not be owned by root"

I encounter the below problem: └─$ sudo apt update && sudo apt full-upgrade -y [sudo] password for kali: Hit:1 http://kali.download/kali kali-rolling InR Reading package lists... Done ...
user avatar
2 votes
1 answer
129 views

Can't connect to postgres using a URI, but can connect with psql -U

I'm trying to set up a simple web server on digital ocean and I'm having trouble connecting to the database with sqlalchemy using a URI. Running root@maudlin:/server/http/maudlin# psql postgresql://...
user avatar
  • 1,725
0 votes
1 answer
121 views

Upgrade 2+ versions of PostgreSQL on Fedora

I have recently upgraded Fedora from 31 to 34 (31->33->34) using dnf. It mostly went smoothly, but I realised that PostgreSQL cannot access my data. Trying to run pg_upgrade, I got Cannot ...
user avatar
0 votes
0 answers
58 views

How to make sure two people are present when accessing a database on a server

My friends and I have a Mattermost instance up on a server through this set up. Mattermost does not support e2e encryption and we have a container with a Postgres database running that stores all of ...
user avatar
0 votes
2 answers
89 views

Cannot connect to postgresql database from init.d script (Debian)

A script that runs just fine normally fails when put into an /etc/init.d/ script (consolenew), to activate at bootup. Specifically, it cannot open the PostgreSQL database, giving the error: could not ...
user avatar
0 votes
1 answer
106 views

Could not bind wireguard address when starting postgresql

I'm running wg-quick.service on system startup to establish a VPN tunnel: root@db ~ # cat /usr/lib/systemd/system/wg-quick@.service [Unit] Description=WireGuard via wg-quick(8) for %I After=network-...
user avatar
  • 101
0 votes
0 answers
49 views

procedure & trigger postgresql add a condition doing it on only one line not all

first I create a trigger and its procedure but procedure is missing a sub-statement in the if part create trigger a_financereconnomiser after update of prix_reel on a_financer execute procedure ...
user avatar
  • 1,136
0 votes
1 answer
255 views

psycopg2.OperationalError: could not connect to server: No route to host Is the server running on host "db" and accepting TCP/IP connections on port

Following the instructions here was fine on openSUSE Tumbleweed with Docker version 20.10.6-ce, build 8728dd246c3a https://github.com/mirumee/saleor-platform#how-to-run-it But on openSUSE Leap 15.3 ...
user avatar
  • 1,315
0 votes
1 answer
264 views

Your database files were created by PostgreSQL version 13

OS is openSUSE Tumbleweed. Previously I had PostgreSQL 13 installed. I just removed it by: > sudo zypper rm 'postgres*' > sudo zypper rr PostgreSQL > sudo rm -rf /usr/local/var/postgres ...
user avatar
  • 1,315
0 votes
0 answers
34 views

Recovering Postgres db from crashed disk

So I got bitten by the Ubuntu 21.04 upgrade bug that trashes the EFI data and hoses the system. (Insert lecture about backing up before upgrading here.) I've reinstalled to a different drive and the ...
user avatar
  • 1
0 votes
1 answer
4k views

libicui18n.so.69 missing PostgreSQL ArchLinux

Problem: I tried to install PostgreSQL following the tutorial from the ArchWiki. As the postgres user, when running the following command: [postgres]$ initdb -D /var/lib/postgres/data I get the ...
user avatar
  • 111
1 vote
1 answer
118 views

Expose postgres server to public network with an intermediate server

I have a postgres server (but it could be any service, I suppose) running in local a network and a server (AWS EC2 instance) that I'd like to use as an intermediary to access the database. So far, I'...
user avatar
  • 11
1 vote
0 answers
165 views

How can I learn why kswapd has very low page reclaim efficiency?

Problem/context I have a (managed) Postgres 10.16 instance running on Fedora 32 in a systemd-nspawn container. Periodically, I see a big spike in "system" CPU usage in our metrics, ...
user avatar
  • 111
0 votes
1 answer
435 views

How to install postgresq 13 in Linux Mint 20.1

Following official instructions here https://www.postgresql.org/download/linux/debian/ but each time it still installs posgresql 12
user avatar
1 vote
1 answer
27 views

Postgres from script shell

Hi I'm trying to create a database with owner ! the owner by default is postgres and I want to change it when a user creates a database read -p "Enter owner database name : " $owner read -p &...
user avatar
0 votes
1 answer
198 views

Execute ./script.sh with a crontab

With Debian GNU/Linux 10 (buster), I'm using a simple script to save a PostgreSQL database and upload it to my Dropbox account with Dropbox-Uploader tool. I schedule this task with a crontab. When I ...
user avatar
  • 109
0 votes
0 answers
60 views

How do I install multiple versions of a package on FreeBSD?

I currently have PostgreSQL 9.5 installed on my FreeBSD 11.4 box. I'd like to upgrade to PostgreSQL 13, and this will require a database migration. All the migration procedures I can find want to have ...
user avatar
0 votes
1 answer
22 views

Restore mysql db from AWS AMI?

We have one EC2 instance running our mysql database server. due to a security incident we had to delete the current EC2 instance as database was completely messed up with some sort of encryption. So ...
user avatar
  • 75
-2 votes
2 answers
548 views

Cannot create /proc/sys/vm/drop_caches: Permission denied

I am using python because i try to run some queries from psql in cold state in a for loop.So before the execution of every query my cache must be clear.I imported os and then i did this: if state==&...
user avatar
0 votes
1 answer
130 views

Install ecpg on Centos 8

How can I install the ecpg tool in Centos8? According to its description, it is included in the postgresql-server-devel.x86_64package, but once installed I can't found it. Moreover, it seems it is not ...
user avatar
  • 101
0 votes
1 answer
443 views

Unable to successfully change Postgresql data_directory and restart Postgres

My goal is to store my postgresql database data on an external ssd hard drive that I have plugged in to a machine running Linux Ubuntu 20.04 LTS ARM x64. I am running into problems when changing the ...
user avatar
1 vote
0 answers
110 views

How to create a ramdisk during a systemd service initialization (ex. Postgresql)?

Is there any way to create a ramdisk during systemd service initialization and run some command after its creation and after the "main" service process starts? Basically what I am trying to ...
user avatar
  • 111
1 vote
0 answers
16 views

Catching the query results executed in the remote PostGreSQL server through expect command inside Python script

I want to catch the PostGres query results that gets executed in the remote server (passwordless-ssh) via expect command that is used to supply the password for the given PostGres user. Actually, ...
user avatar
0 votes
1 answer
2k views

How to resolve bash: GRANT: command not found in PostgreSQL on debian OS?

I sent the below code for creating a new database and user in PostgreSQL su - postgres postgres@$ createuser green Created Successfully postgres@$ createdb greenland Created Successfully **...
user avatar
1 vote
1 answer
754 views

coverting timestamp to epoch seconds and vice versa in PostgresSQL

I can run below queries to get the epoch seconds from date and can covert back them to given date in Google bigquery. For example: select unix_seconds(timestamp('2020-12-04 00:00:00')), unix_seconds(...
user avatar
0 votes
2 answers
528 views

Creation of postgresql table on docker run

I want to create a Dockerfile that runs a PostgreSQL database when I run that container. So what I did was making a Dockerfile: FROM postgres:latest COPY *.sh /docker-entrypoint-initdb.d/ The ...
user avatar
0 votes
0 answers
2k views

yum update returns conflicts with postgresql

cat /etc/centos-release CentOS Linux release 8.3.2011 yum update returns errors as seen below, some conflicts with postgresql 12 installation. Following this guide: Install psql 12 on Centos8 I ...
user avatar
  • 101
0 votes
1 answer
2k views

Not able to install PostgreSQL 9.6 on RHEL7.0

While i am intalling postgresql repo,i am facing the below.i tried with dowload and install but no luck.please give any suggestions. yum install https://download.postgresql.org/pub/repos/yum/9.4/...
user avatar
  • 1
1 vote
1 answer
283 views

Spool/Capture output of COPY command in postgres/Redshift in shell script

I have shell script which will insert data into Redshift/Postgres database using psql command and i am using > for capturing script output. It captures everything but not how many rows inserted. ...
user avatar
0 votes
2 answers
373 views

How to install PostGIS on CentOS 8

I'm having a hard time installing PostGIS on CentOS 8. First I installed the PostgreSQL 12 with this tutorial. Then I headed to this page: You will also need to install and/or build GEOS, Proj, GDAL, ...
user avatar
  • 1
1 vote
3 answers
474 views

How to setup SSH user just to access postgres and do nothing else

I need to grant somebody read only access to a postgres sitting inside a ubuntu 18.04 server For the postgres I did the following CREATE ROLE read_only_user WITH LOGIN PASSWORD 'FAKEPASSWORD123' ...
user avatar

1
2 3 4 5 6