Re: Creating a new DB on a fresh installation - Mailing list pgsql-cygwin

From mike g
Subject Re: Creating a new DB on a fresh installation
Date
Msg-id 1089428719.10763.2.camel@localhost.localdomain
Whole thread Raw
In response to Creating a new DB on a fresh installation  ("Mark Borins" <mark.borins@rigadev.com>)
List pgsql-cygwin
Is this the Home version of XP?

Did you see this posting?

thank your very much for your pointing me to the set-variable cygwin.
although i did "cygwin=server" in my script, i did too little. i missed
the export-statement to the set-variable.

for everybody who is interested in my functioning scripts (on
win-xp-home) i give it in here:

at first i do an initiation of my postgresql-db "pgini" and at the end i
call my script "db-stop" to clean memory of processes (especially
cygserver).

and after that i call my db with "db-start" every time i need it (i
don't use it as a service, i don't use it for production just for
programming), and at the end of my working with my db i call my
"db-stop" again to clean memory. afterwards i exit cygwin or restart my
db with "db-start".

now my scripts:

my "pgini":

#!/bin/sh
# the first very important set-variable
CYGWIN=server
export CYGWIN
# the second very important set-variable - to unset it worked for me
(then language-setting is C).
unset LANG
echo
# the third very important set-variable
PATH=/usr/bin:/usr/sbin:$PATH
export PATH
#echo "IPC-Daemon starten..."
echo
echo "cygserver-config starting..."
cygserver-config
echo "sygserver starten..."
cygserver &
ps -f
echo
echo "initdb starting..."
initdb -D /var/postgresql/data
ps -f
./db-stop

now "db-start":

#!/bin/sh
CYGWIN=server
export CYGWIN
PATH=/usr/bin:/usr/sbin:$PATH
export PATH
echo
echo "sygserver starting..."
cygserver &
ps -f
echo
echo "PostgreSQL starting..."
postmaster -i -D /var/postgresql/data &
ps -f

and finally "db-stop":

#!/bin/sh
echo
echo "PostgreSQL finishing..."
pg_ctl stop -w -D /var/postgresql/data -s -m smart
ps -f
echo
echo "cygserver finishing..."
kill $(ps -f | grep cygserver | awk '{print $2}')
ps -f

greetings and thanks to all
hans
On Fri, 2004-07-09 at 16:27, Mark Borins wrote:
> I have been trying for some time now to get my installation of Postgres
> running under cygwin.
>
> Windows XP SP 1
> Latest version of Cygwin
> Latest version of Postgres  7.4.3 I believe
>
> When I try to create a new db using the template1 in pgadmin I get the
> following error message:
>
> ERROR:  could not initialize database directory
> DETAIL:  Failing system command was:  cp -r
> '/usr/share/postgresql/data/base/1' '/usr/share/postgresql/data/base/17145'
> HINT:  Look in postmaster's stderr log for more information
>
> When I look in the error log I see the following:
> ERROR:  could not initialize database directory
> DETAIL:  Failing system command was: cp -r
> '/usr/share/postgresql/data/base/1' '/usr/share/postgresql/data/base/17144'
> HINT:  Look in the postmaster's stderr log for more information.
> cp: cannot stat `/usr/share/postgresql/data/base/1': No such file or
> directory
>
> So has anyone had this problem?  Anyone know how to fix it?
>
> I imagine it has something to do with file permissions in windows but I have
> been playing with those too and I am completely stuck.
>
> Thanks for any help
> Mark
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings

pgsql-cygwin by date:

Previous
From: "Mark Borins"
Date:
Subject: Creating a new DB on a fresh installation
Next
From: mike g
Date:
Subject: Re: Cant compile7.4.3