Em 29/05/13, Émerson Eng.<[email protected]> escreveu:
> Eu uso o pg_dump e pg_restore regularmente.
> O que eu quiz dizer é que a interface do psql dentre outras coisas permite
> restaurar uma base assim:
> psql -U user -h host -q base *<* base.backup
>
> Fiquei curioso se o psql também faria backup com algo próximo a isso:
> psql -U user -h host -q base *<* base.backup
>
>
Mas
psql -U user -h host -q base < base.backup
é praticamente equivalente a
psql -U user -h host -q base -f base.backup
Do manual:
"-f filename
--file=filename
Use the file filename as the source of commands instead of reading
commands interactively. After the file is processed, psql terminates.
This is in many ways equivalent to the meta-command \i.
If filename is - (hyphen), then standard input is read.
Using this option is subtly different from writing psql <
filename. In general, both will do what you expect, but using -f
enables some nice features such as error messages with line numbers.
There is also a slight chance that using this option will reduce the
start-up overhead. On the other hand, the variant using the shell's
input redirection is (in theory) guaranteed to yield exactly the same
output you would have received had you entered everything by hand."
Osvaldo
_______________________________________________
pgbr-geral mailing list
[email protected]
https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral