Questions tagged [pg-dump]

pg_dump is a utility for backing up a PostgreSQL database.

656 questions
0
votes
1 answer

Single quotes stored in a Postgres database

I've been working on an Express app that has a form designed to hold lines and quotes. Some of the lines will have single quotes('), but overall it's able to store the info and I'm able to back it up and store it without any problems. Now, when I…
Andrew R
  • 151
  • 1
  • 1
  • 7
0
votes
0 answers

Postgres - copying a table from a dump file

I have a database dump that I generated with pg_dump, like so: pg_dump -C remote_db -a --no-owner -t my_table > dump.sql and I'm looking to copy a single table over from it into my local database, with data only (not schema) and with no ownership…
zoopz
  • 1,099
  • 2
  • 9
  • 10
0
votes
2 answers

using pg_dump on remote desktop

I am a novice postgres user employing pgAdminIII on a Windows desktop to connect to a remote postgres db. It connects ok, and everything from within the gui works fine on a very small database. Now I need to make a dump of the whole database (for…
0
votes
1 answer

postgresql, ERROR: permission denied for relation django_migrations

i'm having troubles trying to make script to auto backup my db of my django app. This is how i create my db for my app: sudo -u postgres psql CREATE DATABASE dapp; CREATE USER backupu WITH PASSWORD 'pass123'; ALTER ROLE backupu SET…
Kevin Ramirez Zavalza
  • 1,629
  • 1
  • 22
  • 34
0
votes
1 answer

Attempting to run pg_dump as user "postgres" returns error related to non-postgres user

When I try to run pg_dump as the user "postgres", $ sudo -u postgres pg_dump I receive the error psql: FATAL: role "username" does not exist where "username" is my OS username (i.e., $USER). It seems like if I were attempting…
JonahHuron
  • 297
  • 1
  • 2
  • 12
0
votes
1 answer

postgres invalid byte sequence for encoding "UTF8"

my origin database is with SQL_ASCII encoding and my future database is with UTF8, wich is in another server. well... I export with this command: pg_dump -v -E UTF8 -Fc -h x.x.x.x old-database-name -U username > backup.dmp and try import with this…
Helio Ferreira
  • 163
  • 1
  • 3
  • 11
0
votes
2 answers

how to restore a postgresql database to the exact same state?

I am trying to create a snapshot of a PostgreSQL database (using pg_dump), do some random tests, and restore to the exact same state as the snapshot, and do some other random tests. These can happen over many/different days. Also I am in a…
thor
  • 21,418
  • 31
  • 87
  • 173
0
votes
0 answers

fixing path pg_dump mistmatch errors

I'm trying to dump my postgres database using pg_dump. When I execute the command I get the following error: pg_dump: server version: 9.5rc1; pg_dump version: 9.4.5 pg_dump: aborting because of server version mismatch I understand there a fair…
Patrick Connors
  • 5,677
  • 6
  • 27
  • 54
0
votes
1 answer

Bash script does not execute in CRON (might be to do with Sudo commands?)

I have a bash script that uses ssh tunneling to get a PSQL dump remotely then puts the dump into a local MySQL database. I can't seem to get CRON to run it. I have performed the following steps: 1) Ran: sudo crontab -e 2) Input the following to get…
ramabrahma
  • 9
  • 1
  • 4
0
votes
2 answers

Export only new data since the last PostgreSQL database export

I have a decent sized PostgreSQL database (approx 6GB & growing). A full backup/export of the database is done every few hours via cron & pg_dump. Specifically, can I export only the changes to the database since the last export? Or perhaps run a…
Christian
  • 123
  • 1
  • 2
  • 7
0
votes
0 answers

Why did pg_dump and restore create differently sized tables?

I copied a postgres table from the production box to our staging box using the following command from the staging box: pg_dump -h p-db -U postgres somedb | psql somedb The job completed just fine, but when I analyzed the size of the tables via…
bbuckley123
  • 1,879
  • 13
  • 18
0
votes
1 answer

how i can backup the database from postgres?

I'm trying to back up the database from Postgres but: C:/Program Files (x86)/PostgreSQL/9.3/bin\pg_dump.exe --host localhost --port 5432 --username "postgres" --no-password --format custom --blobs --verbose --file "projet" "postgis_21_sample" …
sara
  • 41
  • 7
0
votes
1 answer

How to find the unix 'host' from the aws 'Endpoint'

I'm looking for the 'host' of an aws database server to use in this configuration option: -h host --host=host Specifies the host name of the machine on which the server is running. If the value begins with a slash, it is used as the directory for…
Brendan W
  • 3,303
  • 3
  • 18
  • 37
0
votes
1 answer

backup postgresql database on seperate gear on openshift

how do I back up my database from openshift in gz format, so that I can import it on my localhost postgres database? I used to use this script: NOW="$(date +"%Y-%m-%d")" FILENAME="$OPENSHIFT_DATA_DIR/$OPENSHIFT_APP_NAME.$NOW.backup.sql.gz" pg_dump…
Lucas03
  • 2,267
  • 2
  • 32
  • 60
0
votes
0 answers

Postgresql table backup restoration

I have a database which contains 50 tables (5 schemas, 5 tablespaces). And tried to take a backup of few tables (each table in different tablespace) using following command. $psql -U my_db_user my_db_name -t my_table_1 -t my_table_2 -t my_table_3 >…
Spike
  • 734
  • 1
  • 12
  • 22