pg_dump is a utility for backing up a PostgreSQL database.
Questions tagged [pg-dump]
656 questions
0
votes
1 answer
C#: pg_restore to different schema
I have .net application which is trying to get data dump using pg_dump and restore using pg_restore.
Here is my data dump code:
public string GetStringArgument()
{
return string.Format("-i -h {0} -p {1} -U {2} -F c -b -v -f {3} -n {4} {5}",…

Gayan
- 1,425
- 4
- 21
- 41
0
votes
1 answer
How do I replace the --D flag for pg_dumpall in Postgres?
I'm trying to create a PostgreSQL backup script using this answer as the basis of my script. The script is:
#! /bin/bash
# backup-postgresql.sh
# by Craig Sanders
# this script is public domain. feel free to use or modify as you…

YPCrumble
- 26,610
- 23
- 107
- 172
0
votes
2 answers
How do I dump a database from online server (heroku) to my local environment?
I have been trying to get the data that I have on my database from the online servers (heroku) and copy it into a local database. I am new to both psql, heroku and basically to the whole concept of building web apps, so forgive me if I sound…

al3x901
- 15
- 2
0
votes
1 answer
pg_dump password in python
I have a ubuntu remote server say 172.123.342.12. I want to take backup of a postgresql database on my local machine via a python script.
My Script is:
def backUp(self):
Pass = 'fb2024d4'
os.putenv("PGPASSWORD",Pass)
dt =…

Manish Gupta
- 4,438
- 18
- 57
- 104
0
votes
0 answers
pg_restore: [compress_io] could not uncompress data: invalid block type
I'm getting this error when I restore a Postgres backup from another server:
pg_restore: [compress_io] could not uncompress data: invalid block type
I haven't found much online about what that error means. Except of this discussion.
Is it a problem…

Stelios
- 29
- 1
- 7
0
votes
1 answer
PostgreSQL .pgpass file with multiple passwords?
Hello I am useing postgresql pg_dump to dump a databases but there are multiple databases on the postgresql instance can the .pgpass file have multiple databases passwords in it.
pg_dump command: -h = host -p =port -U = user -w = look for .pgpass…

user2821177
- 25
- 1
- 6
0
votes
1 answer
django cms shows blank pages on using a restored postgres db dump
In the process of migrating a site to another host I made a postgres dump using the commands
sudo -u postgres pg_dump -F c -a -v -f /tmp/cms_2015.dump cms
and restored it using
sudo -u postgres pg_restore -d cms -v /tmp/cms_2015.dump…

Bwire
- 1,181
- 1
- 14
- 25
0
votes
0 answers
pg_dump error input/output error backup cannot complete
I keep on getting this error when backing up my database using pgAdmin III
pg_dump: [archiver] could not write to output file: input/output error
pg_dump: *** aborted because of error
I still have space on my file system. I'm backing up using PLAIN…

user2773013
- 3,102
- 8
- 38
- 58
0
votes
1 answer
Syntax Errors When Importing pg_dump sql file
I am trying to restore an SQL file I created from a pg_dump however trying to load the dump into a new host and I am getting many syntax errors as seen below:
psql:subscription_dump.sql:3741: ERROR: syntax error at or near "We"
LINE 1: We need to…

ComputerLocus
- 3,448
- 10
- 47
- 96
0
votes
0 answers
How to use pgdump to download specific rows?
I want the exact inserts for only a subset of rows in a table. For argument's sake, let's say that set is determined by:
select * from uses where created > current_date - 2
How would I use pg_dump to get the exact inserts for those specific…

rockstardev
- 13,479
- 39
- 164
- 296
0
votes
1 answer
PostgreSQL: Database backup and Recovery?
What is the procedure to take database backup and recovery in PostgreSQL 9.3?
I am using SQL Dump for the same, but getting an error near pg_dump.
--Example
pg_dump testdb > backupfile
--Error occurred
ERROR: syntax error at or near "pg_dump" …

Sarfaraz Makandar
- 5,933
- 16
- 59
- 84
0
votes
1 answer
pg_dump from 9.1.7 to 9.1.11
I would like to import a table from another postgress database (9.1.7) to mine which is (9.1.11). I tried to import the dump but I get a bunch of syntax errors, I'm assuming there is some issue with the version mismatch?
Is there a better solution…

RandomUser
- 4,140
- 17
- 58
- 94
0
votes
1 answer
using heroku pg_dump in development
I am trying to use a pg_dump from heroku in my dev environment.
Seems like I can use pg_restore to do it once I have downloaded the dump:
http://www.postgresql.org/docs/current/static/app-pgrestore.html
I am unable to use the utility correctly and…

codeObserver
- 6,521
- 16
- 76
- 121
0
votes
1 answer
Cannot get rid of following error "pg_dump: aborting because of server version mismatch" on Lion OSX
I am trying to download the dump of a database on Heroku in the following way:
pg_dump dc6psqngs8h580 -h url_address -U user_name> db.sql
but I am getting this error all the time:
pg_dump: server version: 9.2.4; pg_dump version: 9.1.5
pg_dump:…

user984621
- 46,344
- 73
- 224
- 412
0
votes
1 answer
Automated way to convert a postgresql database to a postgresql schema in a different database?
Is there an automated way to take a postgresql database and convert it into a postgresql schema that can be loaded into a new database?
I played around with this and found two ways to do what I want to do, but both are troublesome, in my honest…

K.Niemczyk
- 1,130
- 3
- 12
- 26