Обсуждение: old database dump.
Hi,
I have an old postgres database backed up using the psql >
database.bak command, as apposed to pg_dump. The database was on a linux
machine.
I'm now trying to restore this db on a windows machine using
pg8.0. However pg_restore cannot recognize the file and psql <
database.bak prompts me for a password. How can I run the psql command
without being prompted for a password. The password prompt and < command
do not mix well as you are prompted for a password and then the command
piped the file to the password prompt. If you know what I mean :(
Is there another means of restoring this database.
Theo
--
_______________________________________________________________________________
Notice from Melbourne Business School Ltd
The information contained in this e-mail is confidential, and is intended for
the named person's use only. It may contain proprietary or legally privileged
information. If you have received this email in error, please notify the
sender and delete it immediately. You must not, directly or indirectly, use,
disclose, distribute, print, or copy any part of this message if you are not
the intended recipient
Internet communications are not secure. You should scan this message and any
attachments for viruses. Melbourne Business School does not accept any
liability for loss or damage which may result from receipt of this message or
any attachments.
______________________________________________________________________________
Use the .pgpass file. On Thu, 1 Dec 2005, Theo Galanakis wrote: > database.bak prompts me for a password. How can I run the psql command > without being prompted for a password. The password prompt and < command -- Jeff Frost, Owner <jeff@frostconsultingllc.com> Frost Consulting, LLC http://www.frostconsultingllc.com/ Phone: 650-780-7908 FAX: 650-649-1954
Alternatively you can login with your password as normal and then once in psql use the '\i filename' command to read in your backup. E.g., psql dbname Password: dbname=# \i database.bak dbname=# \q Regards - Paul Breen --- Jeff Frost <jeff@frostconsultingllc.com> wrote: > Use the .pgpass file. > > On Thu, 1 Dec 2005, Theo Galanakis wrote: > > > database.bak prompts me for a password. How can I > run the psql command > > without being prompted for a password. The > password prompt and < command > > -- > Jeff Frost, Owner <jeff@frostconsultingllc.com> > Frost Consulting, LLC > http://www.frostconsultingllc.com/ > Phone: 650-780-7908 FAX: 650-649-1954 > > ---------------------------(end of > broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster >
Paul Breen <paul.breen6@btinternet.com> writes:
> Alternatively you can login with your password as
> normal and then once in psql use the '\i filename'
> command to read in your backup.
Or use "psql -f file" instead of "psql < file".
regards, tom lane
Thanks Tom and Paul for your advice.
-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of Tom Lane
Sent: Friday, 2 December 2005 2:40 AM
To: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] old database dump.
Paul Breen <paul.breen6@btinternet.com> writes:
> Alternatively you can login with your password as
> normal and then once in psql use the '\i filename'
> command to read in your backup.
Or use "psql -f file" instead of "psql < file".
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend
--
_______________________________________________________________________________
Notice from Melbourne Business School Ltd
The information contained in this e-mail is confidential, and is intended for
the named person's use only. It may contain proprietary or legally privileged
information. If you have received this email in error, please notify the
sender and delete it immediately. You must not, directly or indirectly, use,
disclose, distribute, print, or copy any part of this message if you are not
the intended recipient
Internet communications are not secure. You should scan this message and any
attachments for viruses. Melbourne Business School does not accept any
liability for loss or damage which may result from receipt of this message or
any attachments.
______________________________________________________________________________