Thread: ...

...

From
Adam Haberlach
Date:
        I'm trying to back up a database, including the user records.  If
I use pg_dump, I can get the table, but I cannot seem to be the user
information.

        If I use pg_dumpall, it seems to have trouble connecting to various
databases (in fact, it attempts to connect even if I merely want the
help page).

        This is with 7.0.2 -- should I upgrade or is this still an issue?

(I really just want a way to create a copy of a database, including
permissions and passwords, so I can make changes, test my interface
code, and then modify the original database.  Is that so wrong?)


--
Adam Haberlach            |A cat spends her life conflicted between a
adam@newsnipple.com       |deep, passionate, and profound desire for
http://www.newsnipple.com |fish and an equally deep, passionate, and
'88 EX500                 |profound desire to avoid getting wet.

Re: trying to back up a database

From
"Oliver Elphick"
Date:
Adam Haberlach wrote:
  >        I'm trying to back up a database, including the user records.  If
  >I use pg_dump, I can get the table, but I cannot seem to be the user
  >information.

pg_dump -d database >dump

should copy the database schema and all data records into dump.

  >        If I use pg_dumpall, it seems to have trouble connecting to various
  >databases (in fact, it attempts to connect even if I merely want the
  >help page).

I don't know what you mean by the last bit.  Are you saying that `man
pg_dumpall'
runs pg_dumpall?

pg_dumpall must be run by postgres, it may well have problems if you
are running it as an unprivileged user.

  >        This is with 7.0.2 -- should I upgrade or is this still an issue?

It's not an issue at all.  You must be doing something weird!
If not, please say what platform you're on, and show your exact commands
and what output you're getting.


--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Jesus saith unto him, I am the way, the truth, and the
      life; no man cometh unto the Father, but by me."
                                John 14:6



Re: trying to back up a database

From
Adam Haberlach
Date:
On Wed, Jan 31, 2001 at 11:27:18PM +0000, Oliver Elphick wrote:
> Adam Haberlach wrote:
>   >        I'm trying to back up a database, including the user records.  If
>   >I use pg_dump, I can get the table, but I cannot seem to be the user
>   >information.
>
> pg_dump -d database >dump
>
> should copy the database schema and all data records into dump.
>
>   >        If I use pg_dumpall, it seems to have trouble connecting to various
>   >databases (in fact, it attempts to connect even if I merely want the
>   >help page).
>
> I don't know what you mean by the last bit.  Are you saying that `man
> pg_dumpall'
> runs pg_dumpall?

    Sorry--I mean that when I type "pg_dumpall -h, it connects", but I guess
that is because it is a simple script.



>
> pg_dumpall must be run by postgres, it may well have problems if you
> are running it as an unprivileged user.

Aha.  That may be my problem, then.

[adam@pinko docs]$ pg_dumpall valhalla -u -s > dbschema.sql
Password: psql: Password authentication failed for user 'adam'
Password: psql: Password authentication failed for user 'adam'
Password: psql: Password authentication failed for user 'adam'
Password: Password: psql: Password authentication failed for user 'adam'
Connection to database 'valhalla' failed.
fe_sendauth: no password supplied


--
Adam Haberlach            |A cat spends her life conflicted between a
adam@newsnipple.com       |deep, passionate, and profound desire for
http://www.newsnipple.com |fish and an equally deep, passionate, and
'88 EX500                 |profound desire to avoid getting wet.

Re: trying to back up a database

From
Peter Eisentraut
Date:
Adam Haberlach writes:

>     Sorry--I mean that when I type "pg_dumpall -h, it connects", but I guess
> that is because it is a simple script.

Nobody ever said that '-h' prints a help screen.

> > pg_dumpall must be run by postgres, it may well have problems if you
> > are running it as an unprivileged user.

Nope

> [adam@pinko docs]$ pg_dumpall valhalla -u -s > dbschema.sql
> Password: psql: Password authentication failed for user 'adam'
> Password: psql: Password authentication failed for user 'adam'
> Password: psql: Password authentication failed for user 'adam'
> Password: Password: psql: Password authentication failed for user 'adam'
> Connection to database 'valhalla' failed.
> fe_sendauth: no password supplied

Password authentication doesn't work with pg_dumpall.  Use something else.

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/


Re: trying to back up a database

From
"Oliver Elphick"
Date:
Peter Eisentraut wrote:
  >> > pg_dumpall must be run by postgres, it may well have problems if you
  >> > are running it as an unprivileged user.
  >
  >Nope

Seeing that the unprivileged user may not have SELECT permission on
some of the tables, he ought to have problems!

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "O come, let us worship and bow down; let us kneel
      before the LORD our maker."            Psalms 95:6