dúvida:
1 - tenho que acessar pg via terminal para rodar o comando certo?
2 - escrevo somente o nome do arquivo OU eu deixo ele numa pasta específica OU eu escrevo o caminho até o arquivo?
3 - esse localhost seria meu ip mesmo? 127... ?
4. Re: Restaurar base de dados PGSql [RESOLVIDO]
removidousa Nenhuma
Post recolhido
Enviado em 03/03/2013 - 14:01h
No exemplo acima estou como root e no diretório que está o arquivo.backup. A base dataBase deve ser criada antes.
5. Re: Restaurar base de dados PGSql [RESOLVIDO]
removidousa Nenhuma
Post recolhido
Enviado em 03/03/2013 - 14:08h
# psql --help
psql is the PostgreSQL interactive terminal.
Usage:
psql [OPTION]... [DBNAME [USERNAME]]
General options:
-c, --command=COMMAND run only single command (SQL or internal) and exit
-d, --dbname=DBNAME database name to connect to (default: "amarildo")
-f, --file=FILENAME execute commands from file, then exit
-l, --list list available databases, then exit
-v, --set=, --variable=NAME=VALUE
set psql variable NAME to VALUE
-X, --no-psqlrc do not read startup file (~/.psqlrc)
-1 ("one"), --single-transaction
execute command file as a single transaction
--help show this help, then exit
--version output version information, then exit
Input and output options:
-a, --echo-all echo all input from script
-e, --echo-queries echo commands sent to server
-E, --echo-hidden display queries that internal commands generate
-L, --log-file=FILENAME send session log to file
-n, --no-readline disable enhanced command line editing (readline)
-o, --output=FILENAME send query results to file (or |pipe)
-q, --quiet run quietly (no messages, only query output)
-s, --single-step single-step mode (confirm each query)
-S, --single-line single-line mode (end of line terminates SQL command)
Output format options:
-A, --no-align unaligned table output mode
-F, --field-separator=STRING
set field separator (default: "|")
-H, --html HTML table output mode
-P, --pset=VAR[=ARG] set printing option VAR to ARG (see \pset command)
-R, --record-separator=STRING
set record separator (default: newline)
-t, --tuples-only print rows only
-T, --table-attr=TEXT set HTML table tag attributes (e.g., width, border)
-x, --expanded turn on expanded table output
Connection options:
-h, --host=HOSTNAME database server host or socket directory (default: "/var/run/postgresql")
-p, --port=PORT database server port (default: "5432")
-U, --username=USERNAME database user name (default: "amarildo")
-w, --no-password never prompt for password
-W, --password force password prompt (should happen automatically)
For more information, type "\?" (for internal commands) or "\help" (for SQL
commands) from within psql, or consult the psql section in the PostgreSQL
documentation.
Report bugs to <pgsql-bugs@postgresql.org>.
6. Re: Restaurar base de dados PGSql [RESOLVIDO]
vitorgpusa Ubuntu
Post recolhido
Enviado em 03/03/2013 - 14:21h
Agora foi tudo certo!
O comando indicado por você funfou (;