Re: Dump Database - Mailing list pgsql-general

From Martin French
Subject Re: Dump Database
Date
Msg-id OFAED2524E.602F67E7-ON80257C9E.0048358C-80257C9E.00485659@romaxtech.com
Whole thread Raw
In response to Dump Database  (José Pedro Santos <zpsantos1@hotmail.com>)
List pgsql-general

pgsql-general-owner@postgresql.org wrote on 17/03/2014 12:50:20:

> From: José Pedro Santos <zpsantos1@hotmail.com>

> To: Postgres Ajuda <pgsql-general@postgresql.org>,
> Date: 17/03/2014 12:56
> Subject: [GENERAL] Dump Database
> Sent by: pgsql-general-owner@postgresql.org
>
> Dear all,
>
> I'm trying to dump my database using the following command after I
> enter as su postgres:
>
> pg_dump - U postgres mydb -f mydb.sql
>
> ... but I'm always having the following message:
>
> pg_dump [archiver] Could not open output file "mydb.sql" : Permission denied
>
> I try to use the same statement using su.. but I didn't manage. Can
> someone give me a help?
>
> I'm using Ubuntu 12.04 LTS and Postgres 9.1.
>
> Kind Regards,
> José Santos



The assumption here is that you're in a directory where you do not have permissions.

try:
# cd
# pg_dump -f mydb.sql -U postgres mydb


It also appears that you have a space between "-" and "U", make sure that it appears: "-U".

Cheers
=============================================

Romax Technology Limited
A limited company registered in England and Wales.
Registered office:
Rutherford House
Nottingham Science and Technology Park
Nottingham
NG7 2PZ
England
Registration Number: 2345696
VAT Number: 526 246 746

Telephone numbers:
+44 (0)115 951 88 00 (main)

For other office locations see:
http://www.romaxtech.com/Contact
=================================
===============
E-mail: info@romaxtech.com
Website:
www.romaxtech.com
=================================

================
Confidentiality Statement
This transmission is for the addressee only and contains information that is confidential and privileged.
Unless you are the named addressee, or authorised to receive it on behalf of the addressee
you may not copy or use it, or disclose it to anyone else.
If you have received this transmission in error please delete from your system and contact the sender. Thank you for your cooperation.
=================================================

pgsql-general by date:

Previous
From: José Pedro Santos
Date:
Subject: Dump Database
Next
From: Adrian Klaver
Date:
Subject: Re: Linux OOM-Killer