Questions tagged [pg-dump]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
39 views

pg_dump can not create directory after increase directory space

I recently run pg_dump to backup database using this command using user postgres : time pg_dump -j 4 -Fd -Z 3 db_profile -f /backup-nfs/ Previously, the size of backup-nfs was 100 G. The pg_dump ...
  • 43
0 votes
1 answer
22 views

pg_dump dumping files to ROOT

I run pg_dump last nite to backup some 111Gb database : time pg_dump -j 5 -Fd -Z 1 db_profans -f /backup-nfs/ I monitor the size growth But, suddenly this morning, the database is down. I check the ...
  • 43
0 votes
2 answers
34 views

postgresql error during pg_dump invalid value for parameter "default_tablespace": "tbs_db1_index"

Can someone help me please? :) Ive 2 servers, want to split databases in exclusive instances, so im migrating my databases 1 by 1 to second server Postgres version 11.16 both servers so here's my ...
  • 5
-3 votes
0 answers
14 views

pg_dump in AWS RDS instance

I do have special case need to take backup (Explicitly pg_dump in compressed format) and push it to S3 bucket possibly. From there, I will take the backup and restore it in another equivalent ...
0 votes
0 answers
110 views

pg_dump permission denied for relation error for owner user

I am attempting to dump out a PostgreSQL database with pg_dump: /usr/bin/pg_dump -f /home/crmpicco/rfc_754622.sql -F c -x -E UTF8 -b --disable-triggers -U root -h tillman.ff1lvb.us-west-2.rds....
  • 145
-1 votes
1 answer
58 views

pg_restore relation error

I am trying to run pg_restore on a file so I am able to use it in postgres. The file is a psql file. I try the command: pg_restore --no-privileges --no-owner -d test backupfile.psql -c -U postgres ...
-1 votes
1 answer
33 views

how to back-up all databases in postgresql iteratively?

I have a large number of databases in postgresql 9.5 which I want to back-up using pg_dump tool. Each back-up should get its name from the corresponding database. when I run SELECT datname FROM ...
  • 3
0 votes
0 answers
30 views

pg_dump Isn't Reading ~/.pgpass

I'm trying to bash script a daily backup of my data using pg_dump. I have a single entry in my ~/.pgpass file, which is properly structured, proper host, port, database, user and password. pg_dump -O ...
  • 121
0 votes
1 answer
114 views

Converting PostgreSQL dump file into CSV files

I have a PostgreSQL database running in a docker container. I used the below command to get a dump file of the Postgres database - "docker exec -t your-db-container pg_dumpall -c -U postgres > ...
1 vote
0 answers
51 views

backup a single user , password and privileges from postgresql

I am moving a database user form one postgresql server . I need to take backup of the user name , password and privileges and restore into another pgsql server. I looked into the documentation and ...
  • 11
0 votes
1 answer
148 views

pg_dump on heavily written production db causing queries to hang

Trying to migrate our existing DB. There are no followers or existing backups that are available to us (they are on our cloud solution, but no available for download). So our only option is to run ...
-2 votes
1 answer
701 views

pg_dump - aborting because of server version mismatch

El error se genero tratando de generar el DUMP: pg_dump -h 192.168.0.56 --no-owner -U user name_db > /var/tmp/dump.sql Output: pg_dump: server version: 12.3; pg_dump version: 9.2.24 pg_dump: ...
0 votes
1 answer
207 views

Postgresql migrate schema with large objects included, but only for this schema

I have a super large database in postgresql 13, the size if 1 TB and I need to migrate only one schema to another database, the problem is that this schema has blobs. So if I migrate with pg_dump and ...
0 votes
0 answers
23 views

Errors messages when pusing data with psql on existing database

So I have a remote postgres database hosted on aws's rds, for a django application. This is still in dev (though obviously would like to start trying to do things right already). I need to upload ...
0 votes
1 answer
196 views

Backing up a DB on remote server

I need to backup a postgres DB which is located on a remote server. This server also hosts a lot of other stuff, and that's why I don't have a general access to the server itself. Therefore I believe ...
0 votes
1 answer
139 views

Make a copy of database with new collation

I have a small hobby project in Django backed by Cloud SQL Postgres instance. Recently I realised that data sorting is not correct and identified it as issue with collation setting. Indeed collation ...
  • 103
1 vote
0 answers
264 views

What's the difference between "--section=data" and "--data-only" of pg_dump/pg_restore?

In the man page of pg_dump/pg_restore, that is mentioned about --data-only option(but I didn't find --section=data) as following: --data-only Dump only the data, not the schema (data definitions). ...
  • 159
0 votes
1 answer
537 views

Copying a PostgreSQL schema and its data from one database to another

I am trying to copy a PostgreSQL schema and it's data from one database to another without impacting the availability of the current schema (old_schema). I would also like to do this for a specific ...
  • 103
2 votes
1 answer
958 views

pg_dump is not the same version as psql

I updated postgres to version 14 with sudo apt upgrade. psql --version psql (PostgreSQL) 14.1 (Ubuntu 14.1-2.pgdg20.04+1) But pg_dump did not upgrade with everything else: pg_dump --version pg_dump (...
1 vote
0 answers
65 views

FK constraint ON DELETE RESTRICT not working on some database instances

My database instances appear to treat FK constraint ON DELETE RESTRICT differently and I don't know why. On production database instance (and a clone, where I do my testing), I believe the RESTRICT is ...
1 vote
1 answer
461 views

How to set search_path during pg_restore?

pg_dump and pg_restore will set search_path to an empty string, which will fail if there are functions that call functions in the public schema without explicitly specifying the schema name (ie: ...
0 votes
0 answers
184 views

pg_dump with proper table dependency analysis?

Is it possible to dump then recreate with proper table analysis, so for example if table A depends on table B, then table B will be dumped first, then the table A something like CREATE TABLE B(...); ...
  • 1,251
0 votes
0 answers
218 views

PostgreSQL - Running out of memory when restoring database from large dump

I have a Postgres database dump in text format, which is roughly 20GB. I am trying to restore the database using the command $ psql DatabaseName < path-to-dump But after I while I get the message ...
  • 1
0 votes
0 answers
97 views

Clone Postgres DB to other machine

I would like to set up a complete clone of my Postgres DB on a different machine. I created a dump with pg_dumpall, but trying to restore it I get multiple errors: psql:dump_04-10-2021_15_20_38.sql:24:...
  • 133
0 votes
0 answers
358 views

How can I exclude Materialised Views from a pg_dump

I'm doing a pg_dump of an AWS RDS database so I can use it for local development, but there are some large tables I want to exclude. I've successfully removed them using the --exclude-table=blah* flag ...
0 votes
0 answers
417 views

pg_dump is NOT including extensions

I'm trying to do a backup / restore of a postgresql 11 database from an RDS instance using pd_dump. The documentation states: When pg_dump is used, the CREATE EXTENSION command will be included in ...
0 votes
1 answer
320 views

pg_restore: error: could not execute query: ERROR: materialized view "ws1_all_formate" has not been populated

I had this error after the execution of pg_restore: pg_restore: finished item 19181 MATERIALIZED VIEW DATA avenant_f pg_restore: from TOC entry 19171; 0 2565914 MATERIALIZED VIEW DATA ...
0 votes
1 answer
326 views

Postgresql: avoid referencing schema in trigger function

I have written function that I registered in a trigger that ensure referential consistency in non-normalized data (like we store agency_id + branch_id and I ensure that a referenced branch is inside a ...
  • 429
1 vote
3 answers
2k views

How can I restore pg_dump file on vm

I created a dump with pg_dump using, sudo -u postgres pg_dump dbname > dbexport.psql I tried to restore that dump with, sudo -u postgres pg_restore -d dbname < dbexport.psql I got an error in ...
  • 111
0 votes
1 answer
267 views

Postgis extension doesn't seem to be taken into account when restoring a PostGIS database: ERROR: type "public.geometry" does not exist

I am struggling trying to restore a PostgreSQL dump that has been made using pg_dump (v. 12+) out of a production database having PostGIS installed, the very first issue is this one when restoring the ...
  • 260
1 vote
1 answer
281 views

pg_dump while inserting data

I need to dump some tables of my postgres database and I am scared of getting inconsistent data.The database is verly large and the dump lasts some minutes. On my research I found a command to dump ...
  • 13
2 votes
1 answer
2k views

pg_restore: error: could not execute query: ERROR: option "locale" not recognized

I'm getting the following error when I'm trying to restore my dump file to another (local) PostgreSQL server (running on Debian GNU/Linux 10.10): pg_restore: error: could not execute query: ERROR: ...
0 votes
0 answers
129 views

pg_dump fills up memory but does not write to disk

What could cause pg_dump to fill up memory and not write to disk? Strace just hangs at a certain point with no errors and database log does not show any errors. Once memory is filled up and swap is ...
  • 898
0 votes
1 answer
732 views

No schema, tables after sucessful restore of PostgreSQL database

I backed up the stack exchange archive database hosted on an RDS instance of PostgreSQL like so: pg_dump stackexchange -h <host> -U postgres -password -o > stack.dmp ...A couple of hours ...
1 vote
1 answer
370 views

Can I make postgres' pg_dump condense the alter table statements in the create table section?

If I use pg_dump to get the schema from my database, I get separate sections for things like keys, constraints etc., like this: CREATE TABLE public.account ( id uuid NOT NULL, db_version ...
0 votes
1 answer
2k views

psql: warning: extra command-line argument "postgres.dolphin.com" ignored

when I using this command to copy table video from database dolphin to database acientbay in Fedora 32, shows error like this: /usr/share/postgresql-13/bin/pg_dump -v -t video -h postgres.dolphin.com -...
  • 527
1 vote
0 answers
220 views

Possible to include the create schema command in pg_dump?

I'm using pg_dump to export only the DDL from a database. It's working fine, however the create schema command is not included in the output file. Here is what I'm using: pg_dump -s -c -t myschema....
  • 333
0 votes
1 answer
537 views

pg_dump. Some COPY processes stuck on 'idle in transaction' after pg_dump completion

We do a dump of huge database (~ 2 TB) via pg_dump command: pg_dump -h 192.168.0.132 -d vodka_factory -U vodka_user -F d -j 10 -v -f /backups/vodka_factory_2021-03-26-23-56.dump/ pg_dump process ...
0 votes
1 answer
430 views

pg_dump - how to split it into directories and files?

I am looking for a way to dump PostgreSQL12 database model into a directory/file structure, instead of a single file - for versioning purposes. I found this old thread, which mentions this exact case ...
0 votes
1 answer
117 views

pg_dump -> import traject using "upsert" paradigm?

Well say I have two physically separate database and I wish to replace database B with data from A. Except that I wish to keep the data in B which does not exist in A? So basically I'd go over each ...
  • 421
4 votes
1 answer
1k views

What is the correct way to make an exact copy of a database with pg_dump?

Basically, I'm trying to make a SQL dump that will make an exact copy of a database: user defined functions, relationships, constraints, tables, data, etc. Is this doable with pg_dump or does psql ...
  • 323
0 votes
1 answer
112 views

Does daily pg_dump mess up postgres cache?

I migrated my geospatial Postgres 12.5 database to another cloud provider. I use postgis and I have around 35GB of data and 8GB of memory. Performances are way worse than on my previous provider, and ...
  • 101
0 votes
1 answer
107 views

Detecting running pg_dump conflicting with schema changes

I use Heroku PostgreSQL and their PGBackups for my production environment. I have found, for reasons that I'm not quite clear on, that at least some schema changes do not run correctly during the time ...
  • 101
1 vote
1 answer
3k views

How to prevent pg_dump from generating "SET default_table_access_method=heap;"?

I have a big dump file that is generated by pg_dump that comes with PostgreSQL v12 client, and it is in customized format instead of plain sql text. The version of the server is PostgreSQL v12 too. ...
  • 159
0 votes
1 answer
737 views

How to get lsn(xid) numbers of transactions from WAL file?

I'm looking for a way of getting transactions from WAL files. Basically I need their LSN numbers. (ideally both transactions LSN numbers and WAL files first and last LSN numbers) I have a PostgreSQL ...
  • 57
1 vote
1 answer
976 views

PostgreSQL pg_dump -E encoding option not working

I have a UTF8 database qdb and I want to back it up to a plain file using the same UTF8 encoding. I am using pg_dump as I don't have pgAdmin working now. I however can't get pg_dump to output a UTF8-...
  • 123
0 votes
1 answer
2k views

pg_restore showing errors when specifying schema when backing up with pg_dump

I have created two different dump files one without specifying the schema, another specifying the public schema without specifying the public schema' pg_dump -h IP_ADDRESS -p 5432 -U my_user -Fc my_db ...
  • 175
0 votes
1 answer
332 views

Error using pg_restore

I am using the following guide to migrate a database from my Windows 10 machine to my Managed Database on Digital Ocean. https://www.digitalocean.com/docs/databases/postgresql/how-to/import-databases/ ...
2 votes
1 answer
191 views

Is there a way to convert a custom format Pg dump file to a directory format?

We create a "custom" format (-Fc) dump file of our production DB each night. One of the things this is used for is restoring into a test DB. We then run a number of update queries to ...
0 votes
2 answers
184 views

Where I run mysqldump or pg_dump, Both services (mysql or postgres) freeze?

I need to create a database without stopping the services and I don't know this answer. I need my web pages to continue working properly in that time. Can someone answer me?

1
2 3 4 5