[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Restoring from backup - help!



I've managed to solve this one, a Postgres permissions problem - see
below. I'm not sure why "sql-ledger" is there - maybe the service
account was different on the restore? GRANTing access permissions to
_every_ table did the trick. Not sure why I have to do that when the
database _owner_ is ledgersmb, but I'll leave that question for the
postgres geeks..

mydataset=# \z
                                          Access privileges
 Schema |               Name                |   Type   | Access
privileges | Column access privileges
--------+-----------------------------------+----------+-------------------+--------------------------
 public | acc_trans                         | table    |                   |
 public | acctrans_entry_id_seq             | sequence |                   |
 public | ap                                | table    |                   |
 public | ar                                | table    |                   |
[..]
 public | taxmodule                         | table    |                   |
 public | taxmodule_taxmodule_id_seq        | sequence |                   |
 public | transactions                      | table    |                   |
 public | translation                       | table    |                   |
 public | vendor                            | table    |                   |
 public | vendortax                         | table    |                   |
 public | warehouse                         | table    |                   |
 public | yearend                           | table    |                   |
(63 rows)

mydataset=# GRANT ALL PRIVILEGES ON TABLE defaults TO ledgersmb;
GRANT
mydataset=# \z
                                                  Access privileges
 Schema |               Name                |   Type   |
Access privileges         | Column access privileges
--------+-----------------------------------+----------+-----------------------------------+--------------------------
 public | acc_trans                         | table    |
                    |
[..]
 public | customertax                       | table    |
                    |
 public | defaults                          | table    |
"sql-ledger"=arwdDxt/"sql-ledger" |
                                                       :
ledgersmb=arwdDxt/"sql-ledger"
 public | department                        | table    |
                    |
[..]

On Mon, Oct 18, 2010 at 12:09 PM, Phil wrote:
> Hi all
>
> Having diligently backed up my dataset, I am having trouble restoring.
> I realised I did not back up the *separate* admin database so have
> re-created that as set out in the installation documentation. I
> restored the database as follows:
>
>
> ..hidden.. ~ $ createdb -O ledgersmb mydataset
> ..hidden.. ~ $ pg_restore -d mydataset mydataset-1.2.0-20100924.sqlc
> ..hidden.. ~ $
>
> So no problems there. However when I try to log in using the newly
> created user I get:
>
> Error!
>
> LedgerSMB/User.pm:207
> SELECT value FROM defaults
> WHERE setting_key = 'version'
> ERROR: permission denied for relation defaults
>
> What could be the problem here?
>