pg_dump is a utility for backing up a PostgreSQL database.
Questions tagged [pg-dump]
656 questions
0
votes
1 answer
Enforcing Foreign Key Constraint Over Table From pg_dump With --exclude-table-data
I'm currently working on dumping one of our customer's database in a way that allows us to create new databases from this customer's basic structure, but without bringing along their private data.
So far, I've had success with pg_dump combined with…

Jorge_Freitas
- 175
- 1
- 12
0
votes
1 answer
PostgresSQL dump file is breaking because of apostrophes and other unescaped chars?
I have a docker container running remotely that I am trying to dump the sql data from, like so:
docker exec -t test_db pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
When I try to run this dump file locally using the command
psql…

tomaytotomato
- 3,788
- 16
- 64
- 119
0
votes
0 answers
PostgreSQL 9.4.11 How to include database ownership and extensions in pg_dump custom compressed dump files?
I used pg_dump -Fc ... to dump my database in a compressed format.
The problem is when I use pg_restore --create -d [some_auxiliary_db] to get the database back. It was restoring it directly to [some_auxiliary_db] even though in pg_dump / pg_restore…

aboudirawas
- 192
- 3
- 21
0
votes
1 answer
How dump table with partitions to single file as one table?
I need to make a dump main table with tables-partitions in one file. Is it possible to do this with some commands in postgresql console or with pg_dump?
Thanks.

Sergey Kurdyukov
- 1
- 2
0
votes
0 answers
Running pg_dump from ShellExecuteEx()
When I attempt to execute pg_dump.exe with ShellExecuteEx(), it returns an exit code of 1 (failed), and I think I may be blind to a simple error I have made.
Here is the command line that works at a command prompt:
"C:\Program…

BobC
- 91
- 3
0
votes
1 answer
pg_dump hangs when launched from Eclipse RCP application
My PostgreSQL is 9.3
I have an Eclipse RCP application that calls a method in Spring application that launches Python script that launches pg_dump command.
pg_dump command works when launched from console
the python script that calls the command…

BanzaiTokyo
- 1,376
- 4
- 17
- 33
0
votes
1 answer
pg_dump: too many command-line arguments when calling from cmd
Im trying to make a backup in a folder C:\Users\Marko Petričević\Documents\Radni_sati_Backup\proba where "proba" is the name of backup file.
My command looks like this:
pg_dump -h 192.168.130.240 -p 5433 -U postgres -F c postgres > C:\Users\Marko…

Marko Petričević
- 333
- 2
- 9
- 20
0
votes
1 answer
How to store a small piece of information in a file without messing with its content?
My question:
How to store the current version of my software in a dump file generated by PostgreSQL?
The reason for my question:
I've developed a JAVA software using the PostgreSQL database. The software is installed locally on each user's…

viniciussss
- 4,404
- 2
- 25
- 42
0
votes
1 answer
Get the dump of postgresql extension
1. Is it possible to get the dump of the Postgresql extension?
I have an extension under development which hypothetically sits on a production server and a lot of scripts like ext_name--1.0.1--1.0.2.sql.
Is there a way, how to get the final version…

Ivo
- 11
- 5
0
votes
1 answer
Postgresql server to server replication
Say I have two remote servers 10.0.0.1 and 10.0.0.2. In both the servers I have postgresql database installed with the same databases. Now what I need is, whatever changes or alterations that are done to the database on server 10.0.0.1 should…

Karthik
- 629
- 2
- 8
- 12
0
votes
1 answer
Creating pg_dump file in OS terminal
I tried to find it out on google, but didn't worked well so I hope to find help here! :)
I am trying to create a pg_dump file on mac osx but there is no \bin folder as needed in cmd on windows.
My question is how to create the pg_dump file on mac…

Mercy
- 37
- 2
- 9
0
votes
1 answer
Upgrading from Postgres 7.4 to 9.4.1
I'm upgrading Postgres from ancient 7.4 to 9.4.1 and seeing some errors.
On the old machine, I did:
pg_dumpall | gzip > db_pg_bu.gz
On the new machine, I did:
gunzip -c db_pg_bu.gz | psql
While restoring I got a number of errors which I don't…

Jim Archer
- 1,337
- 5
- 30
- 43
0
votes
0 answers
Why is pgdump only listing one of the three tables that I want data for?
I’m using Postgres 9.5 on Mac Sierra. I want to output data from three tables so I have done this
pg_dump -U mydb --format plain --section data --column-inserts --file "t1.backup" --table “addresses” --table “table1” --table "table2" mydb
The…

Dave
- 15,639
- 133
- 442
- 830
0
votes
1 answer
Postgres pg_dump issue
Good Day,
I've been trying to restore a dump file using the psql client and I'm getting this error:
psql.bin:/home/user/Desktop/dump/dumpfile.sql:907:
ERROR: more than one function named "pg_catalog.avg"
CONTEXT: COPY pg_aggregate, line 1, column…

user1803784
- 82
- 1
- 13
0
votes
0 answers
Odoo's backing up database using pg_dump, Odoo's UI command being used
I've been studying how to use pg_dump and creating a batch file in order to backup the database of my PostgreSQL since the pgAgent is not appearing on the pgAdmin 3 that Odoo installed on my machine. We all know that there's a method in backing up…

sshanzel
- 379
- 5
- 18