Questions tagged [pg-dump]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
26 views

How to take backup of PostgreSQL 9.4 database to remote server using pg_basebackup?

We want to take the logical and base backup on different server machine in the network. Currently both backups are running on same server machine causing space issues. We have the scripts in place ...
0
votes
1answer
19 views

Differences between .out and .sql in pg_dump PostgreSQL

I create a backup file of postgeSQL database: >pg_dump --dbname=db_test --host=localhost --username=user -F c -f dump_test.out In documentation for pg_dump is used extension .sql and for ...
0
votes
1answer
12 views

postgres database with multiple database object owners and pg_dump

with a postgres 11.2 database with multiple database object owners and trying to use the following command as the database owner (not the postgres superuser): pg_dump -h hostname -p 5432 -U ...
0
votes
0answers
23 views

How Can I Move Column Definitions From One Table to Another (psql PostgreSQL)?

I have added many new columns to a table in my database in my local environment with ADD COLUMN statements, over 30. My application is split into multiple environments (UAT, STAG, PROD) and we are ...
0
votes
2answers
28 views

How should I be backing up Postgres for this scenario?

So the way I have been backing up Postgres is with: pg_dumpall -U eox-dev -h localhost --clean --file=/home/backups/postgres.sql I want to make sure I have a production ready backup that has ...
1
vote
1answer
36 views

Database Size is Different after pg_restore (389 GB vs 229 GB)

I created a backup of my database in a PostgreSQL 11.6 (with TimescaleDB 1.60 extension) using pg_dump: PGPASSWORD=mypassword pg_dump -h 127.22.0.4 -p 5432 -U postgres -Z0 -Fc database_development ...
1
vote
1answer
1k views

How to Install postgresql-client-11 on Ubuntu 18.04

I need to use the pg_basebackup/pg_dump program on an Ubuntu 18.04 system to connect to a remote PostgreSQL 11.6 server. However, the current system only contains pg_basebackup 10.10 and the remote ...
0
votes
2answers
342 views

pg_restore: error: could not read from input file: end of file

I do try to create a dump of a table, that is stored inside of my database. The table is called webapp_product In order to create the dump, I do use following commands: docker-compose exec db1 ...
0
votes
1answer
48 views

Are there limitations on using pg_dump on a materialized view such that the data won't be included in the results?

I have a database, call it maps, which contains 2 schemas, a & b. In each schema I have a number of tables: a.t1, a.t2, b.t1, b.t2 (plus others). The column sets on each of these tables is ...
0
votes
2answers
219 views

How do I dump a Postgres table and restore under another user/role?

I am getting an error when I try to restore a Postgres database table to a different user/role than from which it was dumped. I am doing the pg_dump as OS user: 'postgres', and doing the restore as ...
0
votes
1answer
41 views

pg_dump - table dependencies when using --table

The documentation says this when using -t table: Note When -t is specified, pg_dump makes no attempt to dump any other database objects that the selected table(s) might depend upon. Therefore, ...
0
votes
0answers
24 views

multiple pg_dump

My Postgres 9.3 cluster has 9 databases. I want to take backup of these databases using pg_dump utility of PostgreSQL 10. Since individual dbs are too large in size (~350GB), I want to run pg_dump ...
0
votes
2answers
117 views

Missing data for one schema in pg_dump

I have a Postgres 9.6 database with several schemas, and a regular backup of this database is done with a command like pg_dump -h localhost -d db -U postgres -Fc -f file.dump When I restored a ...
0
votes
1answer
26 views

Using pg_dump to create 144 backups per day

Imagine the following scenario (this may not be a viable or sensible idea but please imagine that it is). Using Ubuntu, a cron job calls pg_dump and backs up a Postgres database every 10 minutes. In ...
0
votes
0answers
28 views

Postgresql strange backup message with docker

I'm trying to backing up my remote PostgreSql database into the local one. The backup command is the following: docker run --rm -e PGUSER=user -e PGPASSWORD=password -e PGDATABASE=db -it postgres:11....
0
votes
2answers
44 views

How to use pg_restore in database with different postgis installation (postgis schema location)?

I have database1 where postgis is installed in the public schema. And database2 where postgis is located in a schema called postgis. When I dump database1.schema1, schema1.table1 references its geom ...
1
vote
2answers
631 views

postgresql pg_dump out of memory

is it possible to limit somehow usage of resources for pg_dump? The problem is, whole DBase is 775GB and i have two very large tables: pg_largeobject table is – 390GB pg_largeobject statistics: ...
0
votes
1answer
52 views

How to dump only create table statements (or table definitions only) with pg_dump in Postgresql

I want only the table definitions, not wiews nor functions. I have a schema named "cvp". I try: pg_dump --schema-only -n cvp -t 'cvp.*' --format plain And I get: pg_dump: No matching tables ...
0
votes
1answer
226 views

pg_restore: [archiver] did not find magic string in file header: please check the source URL and ensure it is publicly accessible

I have been trying to push a dump file from my local Postgrel DB (which I uploaded into my Google Drive and is accessible to public) into my Heroku remote DB with the following URL: heroku pg:backups:...
1
vote
1answer
287 views

Postgresql cannot restore partial pg_dump “relation ”public.my_table_seq“ does not exist”

In my database I dumped some tables via the following psql command: pg_dump -t my_table1 -t mytable2 > my_dump.sql And I try to import it into a postgresql docker image as a standalone database ...
0
votes
0answers
172 views

pg_dump not recognized, even though I've confirmed the binary is present

I'm trying to do a dump of a table in PostgreSQL via pgAdmin3. When I try to run the the following command: pg_dump -t schema.table_name database_name > chosen_save_name.sql it errors out and ...
-1
votes
1answer
1k views

pg_restore error while initializing. (Closed)

I am getting the error of: pg_restore: [archiver (db)] Error while INITIALIZING: pg_restore: [archiver (db)] could not execute query: ERROR: unrecognized configuration parameter "...
0
votes
0answers
163 views

Can I get pg_dump to simplify the ACL commands?

When using pg_dump with a database with non-default schema foo like so: pg_dump --schema-only --schema='foo' -U myuser -d mydb -h myhost -W > mydb.sql The SQL dump file is full of these seemingly ...
2
votes
1answer
48 views

pg_restore “CREATE CAST” not executed if using public or pg_catalog schemas

While moving database to another instance I'm using pg_dump and pg_restore with intermediate file. Dump file was created like this: pg_dump --host $SRC_DB_HOST --port 5432 "dbname=$SRC_DB user=$...
1
vote
0answers
79 views

pg_dump does not return schema for repmgr objects

While trying to browse repmgr.monitoring_history, I noticed it has many tens of millions of records. Wanting to get a peak at the indexes that (may or may not) already exist on the table, I try a ...
0
votes
1answer
414 views

Moving a large table from Localhost to remote server

Postgres 11, Windows 10, pgAdmin 4 I have a large post-gis enabled table (29million rows, 20GB + a 5GB spatial index) stored on my local machine (localhost). I want to move this table to an AWS ...
0
votes
1answer
52 views

PSQL incomplete backup : how to debug

I've been doing backups of my database " screen ". after connecting to PSQL and typing \l+ I'm getting (among other things): Name | Owner | Encoding | Collate | Ctype | ...
0
votes
0answers
392 views

pg_dump can't write to drive C | Windows 10

Problem is just as the title says. pg_dump literally can't write to anywhere on drive C: - the drive windows is installed on. More details: created Temp folder on C: drive modified access - added ...
1
vote
0answers
81 views

Dumping Postgres schema from Google cloud SQL

Now this may look trivial but it is a managed service so I don't have the superuser rights. And various schema/tables/sequences have different roles/users as their owners so I can't just use pg_dump ...
0
votes
0answers
81 views

DROP DEFAULT on psql restore fails because column not existing anymore

A dump creates a command to remove default values like: ALTER TABLE IF EXISTS test.simulation ALTER COLUMN gid DROP DEFAULT; When on restore the column with the default value do not exist anymore, ...
0
votes
1answer
2k views

PostgreSQL pg_dump custom file input not dumping data

When I'm using custom format (-Fc) in pg_dump, the file is smaller (42kb), and when I restore it, it only restores the tables and columns, not the data. But when I try to use plain text (-Fp), the ...
0
votes
1answer
73 views

Veryfing pg_restore database with pg_dump database

I just did a migration from Postgres 9.4 to 10 database. How to verify if everything is okay? I tried to look into huge tables, the rows are different (somehow in Postgres 10 then are more rows than ...
0
votes
2answers
515 views

Postgres Backup fails with: pg_dump: could not fsync file: Bad file descriptor

I am running Postgres 11 on Windows 10 and this should be my last backup before moving to Linux: "C:\PostgreSQL\pg11\bin\pg_dump.exe" -U postgres -h localhost -p 5432 --verbose --jobs=4 --format=d --...
0
votes
1answer
567 views

Migrate complete postgres database cluster to another machine using pg_dump

I am referring to How to get a working and complete PostgreSQL DB backup and test In this example/solution, which part of the restore process does actually the "CREATE DATABASE sandbox"? I have been ...
3
votes
1answer
421 views

pg_dump custom archive and create backup date

I have archive file with custom format created by pg_dump. Does it contain the backup creation date? I can't create backups by myself. I receive the archived files over specific network channel. ...
0
votes
2answers
87 views

Does pg_dump flag -j give performance improvement up to -j 16 or -j 32 or even -j 64?

I am backing up and restoring a large DB (7+TB) ... I am using pg_dump -j 8 -Fd (8 parallel dump threads with directory formatting). I just wondered if anybody has tested with a higher -j value ...
0
votes
2answers
456 views

pg_dump: Write failed: Connection reset by peer

we are trying to move all database data to other location. we chose to perform pg_dump and we encountered few problems: first was out of memory problem: during pg_dump initialization we get an error: ...
1
vote
1answer
322 views

how to automatically create the associated schema when I `pg_restore` a table?

I backed a table into a file using something like pg_dump --table=ex.tab. But when I restore the dump file into a newly created database, it complains that the schema ex does not exist. Looking into ...
0
votes
1answer
174 views

Need a “pg_dump” command to take the backup of the child tables along with its master table for PostgreSQL database

We have one master table and multiple child tables (dependent tables) associated with it. While taking the backup of the master table , I would like to take the backup of all its child (dependent) ...
0
votes
1answer
613 views

How to know or recover my pg_dump password? [closed]

I would like to backup my Postgre db using pg_dump. However, the first question asked by the prompt is the password. But I have no idea what it is. Indeed, it is different from my admin account ...
0
votes
1answer
58 views

Retrieving database dump after copying from remote server

I used command pg_dump -C -h remotehost -U remoteuser db_name | psql localhost -U localuser to copy database on remote server to my local machine. Can I somehow retreive the dump obtained after ...
1
vote
2answers
372 views

How to dump multiple databases of the same cluster in single execution?

I have 100 databases in my cluster. I need to backup 30 databases (as single file or multiple file, anything is fine). I could do it for tables using pg_dump with -t. Is there any way to do ...
1
vote
0answers
112 views

Can pg_dump be broken into batches for large DBs?

I have a fairly huge DB and pg_dump croaks on me when I try to export it to a single file. Is there a way to do it in batches, whereby each batch would cover a segment of tables and export the schema/...
0
votes
1answer
903 views

importing-a-sql-db-dump-postgres11 pgadmin4

I have a SQL dump file: C:\Users\Rayyan\Desktop\dump_2.sql. I have been trying to import this for so long. I am using pgadmin 4, and since I could find nothing in that GUI to help, I tried using ...
2
votes
0answers
859 views

PostgreSQL 10.3 pg_dumpall fails: server closed the connection unexpectedly

System: Windows 10 Pro 64bit, Version 10.0.17134 Build 17134. with Postgres 10.3 db server. I backup my postgres db using the following statements: "C:\PostgreSQL\pg10\bin\pg_dumpall.exe" -U ...
1
vote
1answer
227 views

pg_dump and pg_dumpall tools backup create zero size backup file from linux putty terminal

I have installed postgres database version 9.6, 10 on OS Centos 7 64 bit. I'm trying to take a backup with this command: -bash-4.2$ pg_dump -h localhost -Fc backupdb > /var/lib/pgsql/...
6
votes
2answers
5k views

Importing large SQL dump with millions of INSERT statements

I need to import a big .sql file (8.1GB when unpacked) into PostgreSQL. I tried to use \i /path/to/file.sql but it is way too slow. How does one speed up the import? I need to import this data weekly....
0
votes
1answer
1k views

How to disable foreign key constraints in Postgres dump file?

I used pg_dump -U postgres -p 65432 --table=tableName --data-only --column-inserts DBName>fileName.sql to dump one particular table's rows. Now I need to insert them to another database but I get ...
2
votes
0answers
498 views

Dump limit in PostgreSQL

I am trying to dump a database which has a size of just over 100 GiB. I am using the following command (with pv to give a progress bar to observe where this problem occurs): pg_dump -h <host> -...
1
vote
1answer
240 views

Change pg_dump directory output to table name instead of object number

pg_dump -F d will result in multiple <number>.dat.gz files which represent the object number in the database. I wish pg_dump create those files in the format <table name>.dat.gz instead so ...