Thread: DB Dump
Hi
PostgreSQL v9.0
Win 7
I am using the following to dump a database.
I get an error – “could not open output file “.........backup”. Permission denied.”
To me, this sounds as if I am required to create an output file in order to get an output file.
In previous versions the output file was created as part of the transaction.
What am I missing?
pg_dump -h localhost -p 5432 -U postgres -v -f "PDW_cp_Nov_2011.backup" PDW
Bob
On Wed, 2011-11-09 at 08:58 -0800, Bob Pawley wrote: > Hi > > PostgreSQL v9.0 > Win 7 > > I am using the following to dump a database. > > I get an error – “could not open output file “.........backup”. Permission denied.” > > To me, this sounds as if I am required to create an output file in order to get an output file. > > In previous versions the output file was created as part of the transaction. > > What am I missing? > > pg_dump -h localhost -p 5432 -U postgres -v -f "PDW_cp_Nov_2011.backup" PDW > I suppose it means that the "PDW_cp_Nov_2011.backup" file already exists but the OS user executing pg_dump has no right to overwrite it. -- Guillaume http://blog.guillaume.lelarge.info http://www.dalibo.com
The file doesn't exist. Just in case, I modified the dump to pg_dump -h localhost -p 5432 -U postgres -v -f "PDW2_cp_Nov_2011.backup" PDW and got the same error. Bob -----Original Message----- From: Guillaume Lelarge Sent: Wednesday, November 09, 2011 9:48 AM To: Bob Pawley Cc: Postgresql Subject: Re: [GENERAL] DB Dump On Wed, 2011-11-09 at 08:58 -0800, Bob Pawley wrote: > Hi > > PostgreSQL v9.0 > Win 7 > > I am using the following to dump a database. > > I get an error – “could not open output file “.........backup”. Permission > denied.” > > To me, this sounds as if I am required to create an output file in order > to get an output file. > > In previous versions the output file was created as part of the > transaction. > > What am I missing? > > pg_dump -h localhost -p 5432 -U postgres -v -f "PDW_cp_Nov_2011.backup" > PDW > I suppose it means that the "PDW_cp_Nov_2011.backup" file already exists but the OS user executing pg_dump has no right to overwrite it. -- Guillaume http://blog.guillaume.lelarge.info http://www.dalibo.com
Following is a copy of the end of running the dump - pg_dump: saving standard_conforming_strings = off pg_dump: saving database definition pg_dump: [archiver] could not open output file "PDW_cp_Nov_2011.backup": Permiss ion denied pg_dump: *** aborted because of error Bob -----Original Message----- From: Guillaume Lelarge Sent: Wednesday, November 09, 2011 9:48 AM To: Bob Pawley Cc: Postgresql Subject: Re: [GENERAL] DB Dump On Wed, 2011-11-09 at 08:58 -0800, Bob Pawley wrote: > Hi > > PostgreSQL v9.0 > Win 7 > > I am using the following to dump a database. > > I get an error – “could not open output file “.........backup”. Permission > denied.” > > To me, this sounds as if I am required to create an output file in order > to get an output file. > > In previous versions the output file was created as part of the > transaction. > > What am I missing? > > pg_dump -h localhost -p 5432 -U postgres -v -f "PDW_cp_Nov_2011.backup" > PDW > I suppose it means that the "PDW_cp_Nov_2011.backup" file already exists but the OS user executing pg_dump has no right to overwrite it. -- Guillaume http://blog.guillaume.lelarge.info http://www.dalibo.com -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
On 11/09/2011 09:58 AM, Bob Pawley wrote: > Following is a copy of the end of running the dump - > > pg_dump: saving standard_conforming_strings = off > pg_dump: saving database definition > pg_dump: [archiver] could not open output file "PDW_cp_Nov_2011.backup": > Permiss > ion denied > pg_dump: *** aborted because of error You don't have permission to the directory where this file is being saved. > > Bob > -- Adrian Klaver adrian.klaver@gmail.com
I'm logged on to my computer as an administrator(and am the only user). What other permission do I need?? Bob -----Original Message----- From: Adrian Klaver Sent: Wednesday, November 09, 2011 10:00 AM To: Bob Pawley Cc: Guillaume Lelarge ; Postgresql Subject: Re: [GENERAL] DB Dump On 11/09/2011 09:58 AM, Bob Pawley wrote: > Following is a copy of the end of running the dump - > > pg_dump: saving standard_conforming_strings = off > pg_dump: saving database definition > pg_dump: [archiver] could not open output file "PDW_cp_Nov_2011.backup": > Permiss > ion denied > pg_dump: *** aborted because of error You don't have permission to the directory where this file is being saved. > > Bob > -- Adrian Klaver adrian.klaver@gmail.com
On 09/11/2011 17:53, Bob Pawley wrote: > The file doesn't exist. > > Just in case, I modified the dump to pg_dump -h localhost -p 5432 -U > postgres -v -f "PDW2_cp_Nov_2011.backup" PDW and got the same error. > Hi Bob, It sounds as if (as Guillaume suggested) the OS user you're working under doesn't have permission to write to the output directory. Check the permissions on the directory and see if that's the case. Ray. -- Raymond O'Donnell :: Galway :: Ireland rod@iol.ie
On 09/11/2011 18:05, Bob Pawley wrote: > I'm logged on to my computer as an administrator(and am the only user). > What other permission do I need?? > Well, does the administrator have write permission to the directory? Ray. -- Raymond O'Donnell :: Galway :: Ireland rod@iol.ie
Opening Command Prompt as administrator solved my problem. Thanks everybody. Bob -----Original Message----- From: Raymond O'Donnell Sent: Wednesday, November 09, 2011 10:41 AM To: Bob Pawley Cc: Adrian Klaver ; Guillaume Lelarge ; Postgresql Subject: Re: [GENERAL] DB Dump On 09/11/2011 18:05, Bob Pawley wrote: > I'm logged on to my computer as an administrator(and am the only user). > What other permission do I need?? > Well, does the administrator have write permission to the directory? Ray. -- Raymond O'Donnell :: Galway :: Ireland rod@iol.ie -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general
On 11/09/11 11:09 AM, Bob Pawley wrote: > Opening Command Prompt as administrator solved my problem. thats a terrible solution. rather, you should be writing your backups to a directory that the current user has permissions to write to. or if the directory you're using is specifically the one you want to use, then grant the appropriate user write privs to it. -- john r pierce N 37, W 122 santa cruz ca mid-left coast