Re: Moving PostgreSQL data directory on Windows

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: Moving PostgreSQL data directory on Windows
Дата
Msg-id 6BCB9D8A16AC4241919521715F4D8BCE92E9BC@algol.sollentuna.se
обсуждение исходный текст
Ответ на Moving PostgreSQL data directory on Windows  (Ottó Havasvölgyi <havasvolgyi.otto@gmail.com>)
Ответы Re: Moving PostgreSQL data directory on Windows  (Ottó Havasvölgyi <havasvolgyi.otto@gmail.com>)
Список pgsql-general
Ok, two things:

First, when using this method, yo uhave to reboot after editing the registry. If you didn't do that, then that's your
problem.Sorry, forgot to mention that. If not, then looking at permissions as Rodrigo suggested is the next step. 

Second, there is of course a nicer way of doing this than editing the registry, that I compleetley forgot about. It's
stillnot as nice as you would want, but it should work. You use pg_ctl unregister to remove the service, and then
pg_ctlregister to register a new one with the new data directory. Doing this you won't hvae to reboot. 


Perhaps this is something we should add to pg_ctl for 8.2? "pg_ctl reconfigure" or something like that? What do others
think?

//Magnus

> -----Original Message-----
> From: Ottó Havasvölgyi [mailto:havasvolgyi.otto@gmail.com]
> Subject: Re: [GENERAL] Moving PostgreSQL data directory on Windows
>
> Magnus,
>
> It's a service, and it is 8.0.6. I have fixed the registry to this
> value: "C:\Program Files\PostgreSQL\8.0\bin\pg_ctl.exe"
> runservice -N "pgsql-8.0" -D "E:\PostgreSQL\data\"
>
> The service does not start.
> This new directory definetely exists. But now there is no
> Event log entry about the error. The log file says nothing
> because it is in the data/pg_log directory.
>
> Thanks,
> Otto
>
>
>
> 2006/1/13, Magnus Hagander <mha@sollentuna.net>:
> > > Hello,
> > >
> > > I would like to move the data directory to another location.
> > > I have done this:
> > > 1. Stop PostgreSQL
> > > 2. Move data directory
> > > 3. Create a PGDATA env. variable to the new location 4. Start
> > > PostgreSQL
> > >
> > > And it cannot start, because it cannot find postgresql.conf.
> > > (in Event log) What should I do now?
> >
> > Are you running it as a service:? If so you need to reconfigure the
> > service. Unfortunatly,the only way to do this is using
> regedit. Go to
> > HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\pgsql-8.1
> >
> > Open the value "ImagePath" and change the data directory.
> >
> > //Magnus
> >
>

В списке pgsql-general по дате отправления:

Предыдущее
От: "Magnus Hagander"
Дата:
Сообщение: Re: Plans for 8.2?
Следующее
От: Ottó Havasvölgyi
Дата:
Сообщение: Re: Moving PostgreSQL data directory on Windows