Обсуждение: My bad...user and database not recognized after reboot

Поиск
Список
Период
Сортировка

My bad...user and database not recognized after reboot

От
Gan Uesli Starling
Дата:
This is on NetBSD 2.0.2 and PostgreSQL 8.0.3

I made a not-so-wise move...

I had run out of space on Unix directory /var and had
decided to move it. I not so cleverly used 'tar -cf' and
'tar -xf' to restore /var in its new location. Alas, it
seems to have set all ownerships in /var to root. Oops!

So...after reboot of the OS, psql now refuses to recognize
the former user (me) or my one and only database. But I am
sure my DB and all are still there because if I do this as
below...

cd /usr/pgdata
ls -laR base > /home/pkg/share/httpd/htdocs/pgsql/ls.txt

,,,which can be viewed here...

http://69.51.152.43/pgsql/ls.txt

...as lots and lots of numbered files, all of dates that
spread over the period of my database being created and
built. I'm guessing that is my database and all, yes?
Surely it is still there and intact...but unrecognized
somehow...I am guessing.

If that be the case, how might I get psql to admit
existence thereof and again allow access?

TIA,

Gan Starling
Kalamazoo MI
USA

Re: My bad...user and database not recognized after reboot

От
Tom Lane
Дата:
Gan Uesli Starling <alias@starling.us> writes:
> I had run out of space on Unix directory /var and had
> decided to move it. I not so cleverly used 'tar -cf' and
> 'tar -xf' to restore /var in its new location. Alas, it
> seems to have set all ownerships in /var to root. Oops!
> ...
> If that be the case, how might I get psql to admit
> existence thereof and again allow access?

"chown -R postgres:postgres /usr/pgdata", or something close to that,
should fix it.

            regards, tom lane

Re: My bad...user and database not recognized after reboot

От
Gan Uesli Starling
Дата:
Tom Lane wrote:
> Gan Uesli Starling <alias@starling.us> writes:
>
>>I had run out of space on Unix directory /var and had
>>decided to move it. I not so cleverly used 'tar -cf' and
>>'tar -xf' to restore /var in its new location. Alas, it
>>seems to have set all ownerships in /var to root. Oops!
>>...
>>If that be the case, how might I get psql to admit
>>existence thereof and again allow access?
>
>
> "chown -R postgres:postgres /usr/pgdata", or something close to that,
> should fix it.
>
>             regards, tom lane
>

But /var is wholly different path from /usr/pgdata and
those paths are as before, thus:

baal: {2} sudo ls -l /usr/pgdata
total 50
-rw-------  1 pgsql  pgsql      4 Oct  2 21:07 PG_VERSION
drwx------  6 pgsql  pgsql    512 Oct 10 23:00 base
drwx------  2 pgsql  pgsql    512 Nov 13 17:20 global
drwx------  2 pgsql  pgsql    512 Oct  2 21:07 pg_clog
-rw-------  1 pgsql  pgsql   3405 Oct  2 21:07 pg_hba.conf
-rw-------  1 pgsql  pgsql   1460 Oct  2 21:07 pg_ident.conf
drwx------  2 pgsql  pgsql    512 Oct  2 21:07 pg_subtrans
drwx------  2 pgsql  pgsql    512 Oct  2 21:07 pg_tblspc
drwx------  3 pgsql  pgsql    512 Oct 21 11:48 pg_xlog
-rw-------  1 pgsql  pgsql  11026 Oct  2 21:07 postgresql.conf
-rw-------  1 pgsql  pgsql     37 Oct  2 21:12 postmaster.opts
baal: {3}