[root@DataB ~]# updatedb
You have mail in /var/spool/mail/root
[root@DataB ~]# locate pg_dump
/etc/alternatives/pgsql-pg_dump
/etc/alternatives/pgsql-pg_dumpall
/etc/alternatives/pgsql-pg_dumpallman
/etc/alternatives/pgsql-pg_dumpman
/root/old/komanda pg_dump pgsql.txt
/root/old/logpg_dump.log
/usr/bin/pg_dump
/usr/bin/pg_dumpall
/usr/pgsql-9.4/bin/pg_dump
/usr/pgsql-9.4/bin/pg_dumpall
/usr/pgsql-9.4/share/locale/cs/LC_MESSAGES/pg_dump-9.4.mo
/usr/pgsql-9.4/share/locale/de/LC_MESSAGES/pg_dump-9.4.mo
/usr/pgsql-9.4/share/locale/es/LC_MESSAGES/pg_dump-9.4.mo
/usr/pgsql-9.4/share/locale/fr/LC_MESSAGES/pg_dump-9.4.mo
/usr/pgsql-9.4/share/locale/it/LC_MESSAGES/pg_dump-9.4.mo
/usr/pgsql-9.4/share/locale/ja/LC_MESSAGES/pg_dump-9.4.mo
/usr/pgsql-9.4/share/locale/pl/LC_MESSAGES/pg_dump-9.4.mo
/usr/pgsql-9.4/share/locale/pt_BR/LC_MESSAGES/pg_dump-9.4.mo
/usr/pgsql-9.4/share/locale/ru/LC_MESSAGES/pg_dump-9.4.mo
/usr/pgsql-9.4/share/locale/zh_CN/LC_MESSAGES/pg_dump-9.4.mo
/usr/pgsql-9.4/share/man/man1/pg_dump.1
/usr/pgsql-9.4/share/man/man1/pg_dumpall.1
/usr/share/man/man1/pg_dump.1
/usr/share/man/man1/pg_dumpall.1
/var/lib/alternatives/pgsql-pg_dump
/var/lib/alternatives/pgsql-pg_dumpall
/var/lib/alternatives/pgsql-pg_dumpallman
/var/lib/alternatives/pgsql-pg_dumpman
pg_restore --host localhost --port 5432 --username "postgres" --dbname "buhsh3_test" --role "postgres" --no-password --section pre-data --section data --section post-data --verbose "/tmp/Buh_sheregesh3-2021-03-31.backup"
[root@DataB ~]# su postgres
bash-4.1$ psql
could not change directory to "/root": Permission denied
psql (9.4.2)
Type "help" for help.
postgres=# create database test_restore template template0;
CREATE DATABASE
postgres=# \q
bash-4.1$ pg_restore --schema-only -d "test_restore" /tmp/Buh_sheregesh3-2021-03-31.backup
pg_restore: [archiver (db)] Error while PROCESSING TOC:
pg_restore: [archiver (db)] Error from TOC entry 8096; 0 0 SHELL TYPE mchar postgres
pg_restore: [archiver (db)] could not execute query: ОШИБКА: тип "mchar" уже существует
Command was: CREATE TYPE mchar;
pg_restore: [archiver (db)] Error from TOC entry 7597; 1255 16396 FUNCTION mchar_in(cstring) postgres
pg_restore: [archiver (db)] could not execute query: ОШИБКА: функция "mchar_in" с аргументами таких типов уже существует
Command was: CREATE FUNCTION mchar_in(cstring) RETURNS mchar
LANGUAGE c IMMUTABLE STRICT
AS '$libdir/mchar', 'mchar_in';
pg_restore: [archiver (db)] Error from TOC entry 7598; 1255 16397 FUNCTION mchar_out(mchar) postgres
pg_restore: [archiver (db)] could not execute query: ОШИБКА: функция "mchar_out" с аргументами таких типов уже существует
Command was: CREATE FUNCTION mchar_out(mchar) RETURNS cstring
LANGUAGE c IMMUTABLE STRICT
AS '$libdir/mchar', 'mchar_out';
pg_restore: [archiver (db)] Error from TOC entry 7600; 1255 16399 FUNCTION mchar_recv(internal) postgres
pg_restore: [archiver (db)] could not execute query: ОШИБКА: функция "mchar_recv" с аргументами таких типов уже существует
Command was: CREATE FUNCTION mchar_recv(internal) RETURNS mchar
LANGUAGE c IMMUTABLE STRICT
AS '$libdir/mchar', 'mchar_recv';
pg_restore: [archiver (db)] Error from TOC entry 7599; 1255 16398 FUNCTION mchar_send(mchar) postgres
pg_restore: [archiver (db)] could not execute query: ОШИБКА: функция "mchar_send" с аргументами таких типов уже существует
Command was: CREATE FUNCTION mchar_send(mchar) RETURNS bytea
LANGUAGE c IMMUTABLE STRICT
AS '$libdir/mchar', 'mchar_send';