How do I restore a plain text postgres .backup file
I exported a postgres db from pgAdmin in a plain format because I wanted to search the whole db text. I then tried to restore the database back but it gives an error saying that the archive file is not valid archive file. How do I restore the db back if it can be restored?
postgresql pgadmin
migrated from stackoverflow.com Feb 21 '12 at 16:57
This question came from our site for professional and enthusiast programmers.
add a comment |
I exported a postgres db from pgAdmin in a plain format because I wanted to search the whole db text. I then tried to restore the database back but it gives an error saying that the archive file is not valid archive file. How do I restore the db back if it can be restored?
postgresql pgadmin
migrated from stackoverflow.com Feb 21 '12 at 16:57
This question came from our site for professional and enthusiast programmers.
add a comment |
I exported a postgres db from pgAdmin in a plain format because I wanted to search the whole db text. I then tried to restore the database back but it gives an error saying that the archive file is not valid archive file. How do I restore the db back if it can be restored?
postgresql pgadmin
I exported a postgres db from pgAdmin in a plain format because I wanted to search the whole db text. I then tried to restore the database back but it gives an error saying that the archive file is not valid archive file. How do I restore the db back if it can be restored?
postgresql pgadmin
postgresql pgadmin
asked Feb 21 '12 at 11:06
yankitwizzyyankitwizzy
191126
191126
migrated from stackoverflow.com Feb 21 '12 at 16:57
This question came from our site for professional and enthusiast programmers.
migrated from stackoverflow.com Feb 21 '12 at 16:57
This question came from our site for professional and enthusiast programmers.
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
run:
psql -U your_user_name your_db_name < your_dump_file
I am on windows 7. Can I do this on windows 7?
– yankitwizzy
Feb 21 '12 at 11:09
it should, if psql frontend is included in the postgresql package. Try to fire up a terminal, then cd to postgresql bin directory and try to run psql
– guido
Feb 21 '12 at 11:13
I tried it now. It didnt work. There is psql.bat file in the postgres bin directory. I am using postgres 8.3
– yankitwizzy
Feb 21 '12 at 11:17
what do you mean with 'it didnt work'? if there is psql.bat however, try with that, it should run psql. look here for help archives.postgresql.org/pgsql-admin/2006-12/msg00091.php
– guido
Feb 21 '12 at 11:22
Sorry I meant there is no psql.bat file in the bin directory
– yankitwizzy
Feb 21 '12 at 11:27
|
show 2 more comments
HOW TO RESTORE NAME AS DEO.BACKUP EXE FILE IN MY PSQL
New contributor
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f13585%2fhow-do-i-restore-a-plain-text-postgres-backup-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
run:
psql -U your_user_name your_db_name < your_dump_file
I am on windows 7. Can I do this on windows 7?
– yankitwizzy
Feb 21 '12 at 11:09
it should, if psql frontend is included in the postgresql package. Try to fire up a terminal, then cd to postgresql bin directory and try to run psql
– guido
Feb 21 '12 at 11:13
I tried it now. It didnt work. There is psql.bat file in the postgres bin directory. I am using postgres 8.3
– yankitwizzy
Feb 21 '12 at 11:17
what do you mean with 'it didnt work'? if there is psql.bat however, try with that, it should run psql. look here for help archives.postgresql.org/pgsql-admin/2006-12/msg00091.php
– guido
Feb 21 '12 at 11:22
Sorry I meant there is no psql.bat file in the bin directory
– yankitwizzy
Feb 21 '12 at 11:27
|
show 2 more comments
run:
psql -U your_user_name your_db_name < your_dump_file
I am on windows 7. Can I do this on windows 7?
– yankitwizzy
Feb 21 '12 at 11:09
it should, if psql frontend is included in the postgresql package. Try to fire up a terminal, then cd to postgresql bin directory and try to run psql
– guido
Feb 21 '12 at 11:13
I tried it now. It didnt work. There is psql.bat file in the postgres bin directory. I am using postgres 8.3
– yankitwizzy
Feb 21 '12 at 11:17
what do you mean with 'it didnt work'? if there is psql.bat however, try with that, it should run psql. look here for help archives.postgresql.org/pgsql-admin/2006-12/msg00091.php
– guido
Feb 21 '12 at 11:22
Sorry I meant there is no psql.bat file in the bin directory
– yankitwizzy
Feb 21 '12 at 11:27
|
show 2 more comments
run:
psql -U your_user_name your_db_name < your_dump_file
run:
psql -U your_user_name your_db_name < your_dump_file
edited Jul 8 '14 at 7:51
Community♦
1
1
answered Feb 21 '12 at 11:07
guidoguido
28626
28626
I am on windows 7. Can I do this on windows 7?
– yankitwizzy
Feb 21 '12 at 11:09
it should, if psql frontend is included in the postgresql package. Try to fire up a terminal, then cd to postgresql bin directory and try to run psql
– guido
Feb 21 '12 at 11:13
I tried it now. It didnt work. There is psql.bat file in the postgres bin directory. I am using postgres 8.3
– yankitwizzy
Feb 21 '12 at 11:17
what do you mean with 'it didnt work'? if there is psql.bat however, try with that, it should run psql. look here for help archives.postgresql.org/pgsql-admin/2006-12/msg00091.php
– guido
Feb 21 '12 at 11:22
Sorry I meant there is no psql.bat file in the bin directory
– yankitwizzy
Feb 21 '12 at 11:27
|
show 2 more comments
I am on windows 7. Can I do this on windows 7?
– yankitwizzy
Feb 21 '12 at 11:09
it should, if psql frontend is included in the postgresql package. Try to fire up a terminal, then cd to postgresql bin directory and try to run psql
– guido
Feb 21 '12 at 11:13
I tried it now. It didnt work. There is psql.bat file in the postgres bin directory. I am using postgres 8.3
– yankitwizzy
Feb 21 '12 at 11:17
what do you mean with 'it didnt work'? if there is psql.bat however, try with that, it should run psql. look here for help archives.postgresql.org/pgsql-admin/2006-12/msg00091.php
– guido
Feb 21 '12 at 11:22
Sorry I meant there is no psql.bat file in the bin directory
– yankitwizzy
Feb 21 '12 at 11:27
I am on windows 7. Can I do this on windows 7?
– yankitwizzy
Feb 21 '12 at 11:09
I am on windows 7. Can I do this on windows 7?
– yankitwizzy
Feb 21 '12 at 11:09
it should, if psql frontend is included in the postgresql package. Try to fire up a terminal, then cd to postgresql bin directory and try to run psql
– guido
Feb 21 '12 at 11:13
it should, if psql frontend is included in the postgresql package. Try to fire up a terminal, then cd to postgresql bin directory and try to run psql
– guido
Feb 21 '12 at 11:13
I tried it now. It didnt work. There is psql.bat file in the postgres bin directory. I am using postgres 8.3
– yankitwizzy
Feb 21 '12 at 11:17
I tried it now. It didnt work. There is psql.bat file in the postgres bin directory. I am using postgres 8.3
– yankitwizzy
Feb 21 '12 at 11:17
what do you mean with 'it didnt work'? if there is psql.bat however, try with that, it should run psql. look here for help archives.postgresql.org/pgsql-admin/2006-12/msg00091.php
– guido
Feb 21 '12 at 11:22
what do you mean with 'it didnt work'? if there is psql.bat however, try with that, it should run psql. look here for help archives.postgresql.org/pgsql-admin/2006-12/msg00091.php
– guido
Feb 21 '12 at 11:22
Sorry I meant there is no psql.bat file in the bin directory
– yankitwizzy
Feb 21 '12 at 11:27
Sorry I meant there is no psql.bat file in the bin directory
– yankitwizzy
Feb 21 '12 at 11:27
|
show 2 more comments
HOW TO RESTORE NAME AS DEO.BACKUP EXE FILE IN MY PSQL
New contributor
add a comment |
HOW TO RESTORE NAME AS DEO.BACKUP EXE FILE IN MY PSQL
New contributor
add a comment |
HOW TO RESTORE NAME AS DEO.BACKUP EXE FILE IN MY PSQL
New contributor
HOW TO RESTORE NAME AS DEO.BACKUP EXE FILE IN MY PSQL
New contributor
New contributor
answered 8 mins ago
Raju KharikapRaju Kharikap
1
1
New contributor
New contributor
add a comment |
add a comment |
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f13585%2fhow-do-i-restore-a-plain-text-postgres-backup-file%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown