Обсуждение: Running initdb from another process

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

Running initdb from another process

От
"Greg Fairbanks"
Дата:

Hi,

 

I am looking at trying to integrate PostgreSQL into our software. Basically, I want to have our

software to spawn postgres so the user doesn’t have to concern themselves with managing the

database. I am using the Windows calls LogonUser and CreateProcessAsUser to start initdb as

an unprivileged user. However, I am running into trouble on Windows Vista. Initdb will startup,

but when it starts postgres.exe, postgres.exe seems to get hung up on the CreateFileMapping

call while setting up shared memory. This only happens on Vista. It works perfectly on Windows

NT4/2000/XP/2003.  I was wondering if anyone had any experience with this type of situation and

could lend any help.

 

Thanks,

Greg

Re: Running initdb from another process

От
Tony Caduto
Дата:
Greg Fairbanks wrote:
>
> Hi,
>
> I am looking at trying to integrate PostgreSQL into our software.
> Basically, I want to have our
>
> software to spawn postgres so the user doesn’t have to concern
> themselves with managing the
>
> database. I am using the Windows calls LogonUser and
> CreateProcessAsUser to start initdb as
>
> an unprivileged user. However, I am running into trouble on Windows
> Vista. Initdb will startup,
>
> but when it starts postgres.exe, postgres.exe seems to get hung up on
> the CreateFileMapping
>
> call while setting up shared memory. This only happens on Vista. It
> works perfectly on Windows
>
> NT4/2000/XP/2003. I was wondering if anyone had any experience with
> this type of situation and
>
> could lend any help.
>
>
I created a Inno setup (http://www.jrsoftware.org/isinfo.php) that does
all that, don't know if it will work on vista, but it should.
You can grab it here:
http://www.amsoftwaredesign.com/downloads/pg_installer_setup.zip
Full source included.

I also use those APIs, but I do it all from a native win32 DLL created
with Delphi. You don't have to concern yourself with
shared memory, so it may work for you.

The setup completely installs postgresql and starts it, all you have to
do is add the files to the setup for your application.

Good luck,

--
Tony Caduto
AM Software Design
http://www.amsoftwaredesign.com
Home of PG Lightning Admin for Postgresql
Your best bet for Postgresql Administration