How to restore a .sql pg_dump on PostgreSQL
I have a dump from an SQL database, it is a .sql file. I tried restoring it in pgAdmin but I get an error: pg_restore: error: input file appears to be a text format dump. Please use psql. Then I…
I have a dump from an SQL database, it is a .sql file. I tried restoring it in pgAdmin but I get an error: pg_restore: error: input file appears to be a text format dump. Please use psql. Then I…
I am trying to execute a SELECT using psql command and Connection URIs psql postgresql://postgres:admin@localhost:5432/newDB -c "select current_date;" But I get this error : psql: warning: extra command-line argument "select current_date;" ignored I do connect to the night database but…
I have a linux server with PSQL installed (psql (15.2 (Ubuntu 15.2-1.pgdg22.04+1))). This is installed on Oracle Cloud. I am trying to connect using the command psql -h 129.213.17.88 -p 5432 -d breedingdb -U postgres Where 129.213.17.88 is the public…
I want to get the list of last n number of table names present in a schema in a particular database. The problem is there are lots of tables and is not convenient to scroll through all of them to…
I am doing pg_dump using - pg_dump -U <username> -h <host> <database> > backup.sql pg_dump is working fine. I am trying to do pg_restore doing - pg_restore -U <username> -h <host> -d <databse> backup.sql Then it is showing pg_restore: error:…
I'm continuously hitting an error when trying to psql into a docker composed postgres image that has its ports forwarded. (this issue seems to persist also when attempting to access the DB programatically via node application). Running docker-compose up -d…
I set up the PostgreSQL using Docker Compose and the content of the file (compose.yaml) is like so: name: postgres-container services: database: image: postgres restart: always environment: - POSTGRES_PASSWORD // OR POSTGRES_PASSWORD = ${POSTGRES_PASSWORD} volumes: - pgdata:/var/lib/postgresql/data volumes: pgdata: I…
This fails with tlsv1 alert unknown ca psql -h localhost -p 4566 -d dev -U root --set=sslmode=disable This works: psql "port=4566 host=localhost user=root dbname=dev sslmode=disable" Why? Why does one work when the other does not? Is the --set ignored? Is…
I installed PostgreSQL and pgAdmin 4 on windows 10. Everything works in pgAdmin, but when i try to use psql i get this error: After running 'help', i can not run any option such as ? or q. If i…
I am trying to create a FOR loop to loop through an array list of table names. Something like list=['tableA','tableB','tableC']; for x in list{ select * from x; } basically doing this select * from tableA; select * from tableB;…