Re: Unable to execute pg_dump

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Unable to execute pg_dump
Дата
Msg-id CAKFQuwbDh3ow0FbMrkNqgKu3mxmEr0o0pwRkaxhcoYtuScYmYw@mail.gmail.com
обсуждение исходный текст
Ответ на Unable to execute pg_dump  (Joseph Maruca <joseph.maruca@masimo.com>)
Список pgsql-general
On Sunday, June 14, 2020, Joseph Maruca <joseph.maruca@masimo.com> wrote:

'''sudo -u postgres -H --psql -pxxxxx -d db_name'''

If I enter the following syntax from the RHEL command line:

'''sudo su postgres'''

I end up in the bash-4.1 shell. When executing the following command from within the shell: bash-4.1$ pg_dump db_name > /tmp/my_database.sql I am presented with the following error:

pg_dump: [archiver (db)] connection to database "db_name" failed: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

Not a RHEL user but...

For psql you specify the port but not for pg_dump.
For psql you seem to be switching to the postgres user’s environment but don’t do that for pg_dump.

In short it seems like you need to trace down your O/S environment differences when each command is run.

David J.

В списке pgsql-general по дате отправления:

Предыдущее
От: Joseph Maruca
Дата:
Сообщение: Unable to execute pg_dump
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Unable to execute pg_dump