Daniel's profileDaniel Teófilo - Tecnolo...BlogListsNetwork Tools Help

Blog


    November 06

    Importando e Exportando uma base de dados no PostGre

    Abaixo vou descrever como importar e exportar uma base de dados no PostGre via linha de comando.
    Primeiro vá no menu iniciar e procure pelo PostGre depois clique no link escrito linha de comando (prompt).
    Feito isso digite a linha abaixo para gerar o DUMP do seu banco:

    PG_DUMP -U postgres -d nomedobanco > caminho

    A linha acima começa com o nome do comano depois o atributo "-U" em seguida o nome do usuário no banco outro atributo "-d" e o nome da sua base que deseja importar em seguida o sinal de maior ">" mais o local onde você quer que seja criado o arquivo de backup.
    Para importar o DUMP que criamos é muito simples, primeiro crie a database no PostGre depois abra a linha de comando do PostGre como descrito acima, ai é só digitar a linha abaixo:

    PSQL -U postgre -f caminho -d nomedobanco

    O nome do comando agora mudou "PSQL" na linha temos três atributos "-U -f -d", postgre é o nome do usuário que estou usando caminho é o local onde seu arquivo está e o nome do banco que você criou para receber o DUMP.

    Com essas duas linhas é muito simples importar e exportar databases no PostGre.

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://danielteofilo.spaces.live.com/blog/cns!71C7D38F76AAE52B!280.trak
    Weblogs that reference this entry
    • None