azure postgres flexible server local dump with pgadmin

Quaderno Elettronico 0 Reputation points
2024-11-22T11:50:25.77+00:00

I am trying to dump my db on an Azure PostgreSQL flexible server with pgAdmin4 on an SSH tunnel. Every time I attempt the dump, I get the following error:

pg_dump: l'ultimo OID predefinito � 16383 pg_dump: lettura delle estensioni pg_dump: identificazione dei membri delle estensioni pg_dump: lettura schemi pg_dump: lettura delle tabelle definite dall'utente pg_dump: lettura funzioni definite dall'utente pg_dump: lettura tipi definiti dall'utente pg_dump: lettura linguaggi procedurali pg_dump: lettura funzioni di aggregazione definite dall'utente pg_dump: lettura operatori definiti dall'utente pg_dump: lettura dei metodi di accesso definiti dall'utente pg_dump: lettura classi operatore definite dall'utente pg_dump: lettura delle famiglie di operatori definiti dall'utente pg_dump: lettura dei parser di ricerca testo definiti dall'utente pg_dump: lettura dei modelli di ricerca testo definiti dall'utente pg_dump: lettura dei dizionari di ricerca testo definiti dall'utente pg_dump: lettura delle configurazioni di ricerca testo definite dall'utente pg_dump: lettura dei wrapper di dati esterni definiti dall'utente pg_dump: lettura dei server esterni definiti dall'utente pg_dump: lettura dei privilegi predefiniti pg_dump: lettura delle collations definite dall'utente pg_dump: lettura delle conversioni definite dall'utente pg_dump: lettura delle conversioni dei tipi pg_dump: lettura delle trasformazioni pg_dump: lettura informazioni di ereditariet� delle tabelle pg_dump: lettura dei trigger di evento pg_dump: ricerca delle tabelle delle estensioni pg_dump: ricerca delle relazioni di ereditariet� pg_dump: lettura informazioni di colonna per le tabelle interessate pg_dump: trovare le espressioni di default della tabella pg_dump: marcatura colonne ereditate nelle sottotabelle pg_dump: reading partitioning data pg_dump: lettura degli indici pg_dump: marcatura indici nelle tabelle partizionate pg_dump: lettura delle statistiche estese pg_dump: lettura dei vincoli pg_dump: lettura dei trigger pg_dump: lettura regole di riscrittura pg_dump: lettura delle regole di sicurezza pg_dump: rimuovi una regola di sicurezza per riga da una tabella pg_dump: lettura delle pubblicazioni pg_dump: lettura pubblicazione appartenenza a tabelle pg_dump: lettura dei membri della pubblicazione pg_dump: lettura delle sottoscrizioni pg_dump: lettura dei large object pg_dump: lettura dei dati di dipendenza pg_dump: salvataggio codifica = UTF8 pg_dump: salvataggio standard_conforming_strings = on pg_dump: salvataggio del search_path = pg_dump: salvataggio definizione del database pg_dump: salvataggio del contenuto della tabella "public.PendingFatt" pg_dump: salvataggio del contenuto della tabella "public.PendingSpese" pg_dump: errore: Lo scarico dei contenuti della tabella "PendingFatt" � fallito: PQgetCopyData() fallito. pg_dump: pg_dump: errore: Lo scarico dei contenuti della tabella "PendingSpese" � fallito: PQgetCopyData() fallito. dettaglio: Messaggio di errore dal server: SSL SYSCALL error: EOF detected pg_dump: pg_dump: dettaglio: Messaggio di errore dal server: SSL SYSCALL error: EOF detected pg_dump: dettaglio: Il comando era: COPY public."PendingFatt" (***) TO stdout; dettaglio: Il comando era: COPY public."PendingSpese" (***) TO stdout; pg_dump: errore: un processo worker � morto inaspettatamente 

I am using the following command to dump my database, the version of postgres is the same:

C:\Program Files\PostgreSQL\16\bin\pg_dump.exe --file "C:\\AZURE\\qehub.backup" --host "127.0.0.1" --port "56588" --username "***" --no-password --format=d --compress "0" --jobs "2" --verbose "dbname"

this is the cmd to get the connection:

az webapp create-remote-connection --subscription *** --resource-group *** -n *** 

After the error the connection to ssh is lost

Is there any other method to backup the db locally, also for many GB dimension?

Azure Database for PostgreSQL
{count} votes

1 answer

Sort by: Most helpful
  1. Sina Salam 22,031 Reputation points Volunteer Moderator
    2024-11-22T15:01:19.3333333+00:00

    Hello Quaderno Elettronico,

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    I understand that you are having issues with azure postgres flexible server local dump with pgadmin.

    I think your issue is not automatic backup and point-in-time recovery (PITR) issue but rather pg_dump error, and error message indicates an SSL SYSCALL error, which often occurs due to network issues, SSH tunnel instability, or server-side problems. Therefore, the below are some steps to resolve this:

    1. The unstable connections can cause interruptions during the dump process, make sure your network connection is stable.
    2. Sometimes, the SSH tunnel might be timing out. and you can increase the timeout settings for your SSH connection, and if possible, try connecting directly to the PostgreSQL server without using an SSH tunnel to see if the issue persists.
    3. You will also need to adjust or reduce the number of jobs (--jobs) to 1 to minimize the load on the server and network.
    4. Look at the PostgreSQL server logs for any additional error messages that might provide more insight.

    If the above steps don't resolve the issue, you can try an alternative method to back up your database by using pg_basebackup is a utility for streaming a base backup of a running PostgreSQL server. It can be used to create a backup of your database cluster.

    pg_basebackup -h 127.0.0.1 -p 56588 -U your_username -D /path/to/backup -Fp -Xs -P
    
    • -h: Host
    • -p: Port
    • -U: Username
    • -D: Destination directory
    • -Fp: Plain format
    • -Xs: Include WAL files
    • -P: Progress

    OR

    • Use Azure's built-in backup service for PostgreSQL flexible server.
    • You can export your database to a BACPAC file, which is a portable format for database backups.

    I hope this is helpful! Do not hesitate to let me know if you have any other questions.


    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.