Thread: postgres on windows with minimal cygwin

postgres on windows with minimal cygwin

From
"Todd F. Peterson"
Date:
i am trying to create a working windows postgres using the minimum amount
of cygwin stuff. started with minimum stuff i knew had to be there like
bash, postgres, etc. then kept trying to do initdb until no errors
appeared. finally suceeded and can run postmaster and psql as
Administrator and with template1 database.

problem is, cannot create a different database using createdb or in psql
with create database. i get the following message and not sure why it is
failing.

template1=# create database test;
WARNING: database directory '/cygdrive/c/cygmin/bin/pg_data/base/16983'
could not be removed
ERROR: CREATE DATABASE: could not initialize database directory; delete
failed as well
template1=#

there is no 16983 directory under base to start with. noticed that each
attempt uses next sequence number so tried to create directory first
manually and then create. here's what i get:

template1=# create database test;
ERROR: CREATE DATABASE: unable to create database directory
'/cygdrive/c/cygmin
/bin/pg_data/base/17013': File exists
template1=#

anybody know what i'm missing?

here's what i have so far for minimum files:
/cygmin

/cygmin/bin
basename.exe
bash.exe
cat.exe
chmod.exe
cp.exe
createdb
createuser
cygiconv-2.dll
cygintl-1.dll
cygintl-2.dll
cygncurses6.dll
cygpcre.dll
cygreadline5.dll
cygwin1.dll
grep.exe
gzip.exe
initdb
less.exe
ls.exe
mkdir.exe
pg_config
pg_controldata.exe
pg_ctl
pg_data (the database directory)
pg_dump.exe
pg_dumpall.exe
pg_encoding.exe
pg_id.exe
pg_resetxlog.exe
pq.dll
psql.exe
rm.exe
rmdir.exe
sed.exe
sleep.exe
stty.exe

/cygmin/tmp

/cygmin/usr/local/bin

ipc-daemon.exe
ipck
ipcrm.exe
ipcs.exe
ipctest.exe




Re: postgres on windows with minimal cygwin

From
Fred Yankowski
Date:
On Tue, Dec 31, 2002 at 12:42:34PM -0700, Todd F. Peterson wrote:
> template1=# create database test;
> WARNING: database directory '/cygdrive/c/cygmin/bin/pg_data/base/16983'
> could not be removed
> ERROR: CREATE DATABASE: could not initialize database directory; delete
> failed as well

That exact output would result if execution of "cp -r" fails in a
system() call in createdb().  Are you sure that the right 'cp' command
is in your $PATH when you invoke the psql or createdb commands?

You might try running createdb under strace.

--
Fred Yankowski      fred@ontosys.com           tel: +1.630.879.1312
OntoSys, Inc        PGP keyID: 7B449345        fax: +1.630.879.1370
www.ontosys.com     38W242 Deerpath Rd, Batavia, IL 60510-9461, USA

Re: postgres on windows with minimal cygwin

From
mlw
Date:
I am doing the exact same thing, in fact there is a Windows console
program floating around that Igor Georgiev started and I did some work
on, if you look at the archives, you may find it.

One thing you may want to do is inspect the registry setting for the
cygwin directory. Make sure it is what you think it should be.

Second, when I was creating my install, I had a full blown cygwin
directory and a smaller postgres version. If you run the ipc-daemon
program while the registry settings are set for the main cygwin
directory, it will cause problems when you try to run from the postgres
directory. You will need to kill the ipc-daemon program, update the
registry, then run ipc-daemon and postgres.

In the console program, mentioned earlier,  it allows for the ipc-daemon
to be run prior to postmaster, and killed at exit. Besides looking nicer
than a DOS window, it also alows loging the output to a file.

Todd F. Peterson wrote:

>i am trying to create a working windows postgres using the minimum amount
>of cygwin stuff. started with minimum stuff i knew had to be there like
>bash, postgres, etc. then kept trying to do initdb until no errors
>appeared. finally suceeded and can run postmaster and psql as
>Administrator and with template1 database.
>
>problem is, cannot create a different database using createdb or in psql
>with create database. i get the following message and not sure why it is
>failing.
>
>template1=# create database test;
>WARNING: database directory '/cygdrive/c/cygmin/bin/pg_data/base/16983'
>could not be removed
>ERROR: CREATE DATABASE: could not initialize database directory; delete
>failed as well
>template1=#
>
>there is no 16983 directory under base to start with. noticed that each
>attempt uses next sequence number so tried to create directory first
>manually and then create. here's what i get:
>
>template1=# create database test;
>ERROR: CREATE DATABASE: unable to create database directory
>'/cygdrive/c/cygmin
>/bin/pg_data/base/17013': File exists
>template1=#
>
>anybody know what i'm missing?
>
>here's what i have so far for minimum files:
>/cygmin
>
>/cygmin/bin
>basename.exe
>bash.exe
>cat.exe
>chmod.exe
>cp.exe
>createdb
>createuser
>cygiconv-2.dll
>cygintl-1.dll
>cygintl-2.dll
>cygncurses6.dll
>cygpcre.dll
>cygreadline5.dll
>cygwin1.dll
>grep.exe
>gzip.exe
>initdb
>less.exe
>ls.exe
>mkdir.exe
>pg_config
>pg_controldata.exe
>pg_ctl
>pg_data (the database directory)
>pg_dump.exe
>pg_dumpall.exe
>pg_encoding.exe
>pg_id.exe
>pg_resetxlog.exe
>pq.dll
>psql.exe
>rm.exe
>rmdir.exe
>sed.exe
>sleep.exe
>stty.exe
>
>/cygmin/tmp
>
>/cygmin/usr/local/bin
>
>ipc-daemon.exe
>ipck
>ipcrm.exe
>ipcs.exe
>ipctest.exe
>
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 4: Don't 'kill -9' the postmaster
>
>
>



Re: postgres on windows with minimal cygwin

From
"Todd F. Peterson"
Date:
Thanks, that's what my troubles were. When you say Windows console, do you
mean a postgres gui or something else?

todd

On Wed, 1 Jan 2003, mlw wrote:

> I am doing the exact same thing, in fact there is a Windows console
> program floating around that Igor Georgiev started and I did some work
> on, if you look at the archives, you may find it.
>
> One thing you may want to do is inspect the registry setting for the
> cygwin directory. Make sure it is what you think it should be.
>
> Second, when I was creating my install, I had a full blown cygwin
> directory and a smaller postgres version. If you run the ipc-daemon
> program while the registry settings are set for the main cygwin
> directory, it will cause problems when you try to run from the postgres
> directory. You will need to kill the ipc-daemon program, update the
> registry, then run ipc-daemon and postgres.
>
> In the console program, mentioned earlier,  it allows for the ipc-daemon
> to be run prior to postmaster, and killed at exit. Besides looking nicer
> than a DOS window, it also alows loging the output to a file.
>
> Todd F. Peterson wrote:
>
> >i am trying to create a working windows postgres using the minimum amount
> >of cygwin stuff. started with minimum stuff i knew had to be there like
> >bash, postgres, etc. then kept trying to do initdb until no errors
> >appeared. finally suceeded and can run postmaster and psql as
> >Administrator and with template1 database.
> >
> >problem is, cannot create a different database using createdb or in psql
> >with create database. i get the following message and not sure why it is
> >failing.
> >
> >template1=# create database test;
> >WARNING: database directory '/cygdrive/c/cygmin/bin/pg_data/base/16983'
> >could not be removed
> >ERROR: CREATE DATABASE: could not initialize database directory; delete
> >failed as well
> >template1=#
> >
> >there is no 16983 directory under base to start with. noticed that each
> >attempt uses next sequence number so tried to create directory first
> >manually and then create. here's what i get:
> >
> >template1=# create database test;
> >ERROR: CREATE DATABASE: unable to create database directory
> >'/cygdrive/c/cygmin
> >/bin/pg_data/base/17013': File exists
> >template1=#
> >
> >anybody know what i'm missing?
> >
> >here's what i have so far for minimum files:
> >/cygmin
> >
> >/cygmin/bin
> >basename.exe
> >bash.exe
> >cat.exe
> >chmod.exe
> >cp.exe
> >createdb
> >createuser
> >cygiconv-2.dll
> >cygintl-1.dll
> >cygintl-2.dll
> >cygncurses6.dll
> >cygpcre.dll
> >cygreadline5.dll
> >cygwin1.dll
> >grep.exe
> >gzip.exe
> >initdb
> >less.exe
> >ls.exe
> >mkdir.exe
> >pg_config
> >pg_controldata.exe
> >pg_ctl
> >pg_data (the database directory)
> >pg_dump.exe
> >pg_dumpall.exe
> >pg_encoding.exe
> >pg_id.exe
> >pg_resetxlog.exe
> >pq.dll
> >psql.exe
> >rm.exe
> >rmdir.exe
> >sed.exe
> >sleep.exe
> >stty.exe
> >
> >/cygmin/tmp
> >
> >/cygmin/usr/local/bin
> >
> >ipc-daemon.exe
> >ipck
> >ipcrm.exe
> >ipcs.exe
> >ipctest.exe
> >
> >
> >
> >
> >---------------------------(end of broadcast)---------------------------
> >TIP 4: Don't 'kill -9' the postmaster
> >
> >
> >
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>


Re: postgres on windows with minimal cygwin

From
mlw
Date:
It is a windows program that captures the stdout and stderr output from postmaster and displays them on the screen.

Todd F. Peterson wrote:
Thanks, that's what my troubles were. When you say Windows console, do you
mean a postgres gui or something else?

todd

On Wed, 1 Jan 2003, mlw wrote:
 
I am doing the exact same thing, in fact there is a Windows console
program floating around that Igor Georgiev started and I did some work
on, if you look at the archives, you may find it.

One thing you may want to do is inspect the registry setting for the
cygwin directory. Make sure it is what you think it should be.

Second, when I was creating my install, I had a full blown cygwin
directory and a smaller postgres version. If you run the ipc-daemon
program while the registry settings are set for the main cygwin
directory, it will cause problems when you try to run from the postgres
directory. You will need to kill the ipc-daemon program, update the
registry, then run ipc-daemon and postgres.

In the console program, mentioned earlier,  it allows for the ipc-daemon
to be run prior to postmaster, and killed at exit. Besides looking nicer
than a DOS window, it also alows loging the output to a file.

Todd F. Peterson wrote:
   
i am trying to create a working windows postgres using the minimum amount
of cygwin stuff. started with minimum stuff i knew had to be there like
bash, postgres, etc. then kept trying to do initdb until no errors
appeared. finally suceeded and can run postmaster and psql as
Administrator and with template1 database.

problem is, cannot create a different database using createdb or in psql
with create database. i get the following message and not sure why it is
failing.

template1=# create database test;
WARNING: database directory '/cygdrive/c/cygmin/bin/pg_data/base/16983'
could not be removed
ERROR: CREATE DATABASE: could not initialize database directory; delete
failed as well
template1=#

there is no 16983 directory under base to start with. noticed that each
attempt uses next sequence number so tried to create directory first
manually and then create. here's what i get:

template1=# create database test;
ERROR: CREATE DATABASE: unable to create database directory
'/cygdrive/c/cygmin
/bin/pg_data/base/17013': File exists
template1=#

anybody know what i'm missing?

here's what i have so far for minimum files:
/cygmin

/cygmin/bin
basename.exe
bash.exe
cat.exe
chmod.exe
cp.exe
createdb
createuser
cygiconv-2.dll
cygintl-1.dll
cygintl-2.dll
cygncurses6.dll
cygpcre.dll
cygreadline5.dll
cygwin1.dll
grep.exe
gzip.exe
initdb
less.exe
ls.exe
mkdir.exe
pg_config
pg_controldata.exe
pg_ctl
pg_data (the database directory)
pg_dump.exe
pg_dumpall.exe
pg_encoding.exe
pg_id.exe
pg_resetxlog.exe
pq.dll
psql.exe
rm.exe
rmdir.exe
sed.exe
sleep.exe
stty.exe

/cygmin/tmp

/cygmin/usr/local/bin

ipc-daemon.exe
ipck
ipcrm.exe
ipcs.exe
ipctest.exe




---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster


     

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command   (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
   

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
 

Re: postgres on windows with minimal cygwin

From
Jason Tishler
Date:
Todd,

On Tue, Dec 31, 2002 at 12:42:34PM -0700, Todd F. Peterson wrote:
> here's what i have so far for minimum files:
> /cygmin
>
> /cygmin/bin
> [snip]
>
> /cygmin/tmp
>
> /cygmin/usr/local/bin
> [snip]

Please post the output of cygcheck -c.  People are always asking, "What
is the minimum required packages for proper Cygwin PostgreSQL operation."

Thanks,
Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6

Re: postgres on windows with minimal cygwin

From
"Todd F. Peterson"
Date:
Jason,

Have built the cygmin by starting with empty directory and copying over
files from my main cygwin install. setup information is not there so
cygcheck produces:

bash-2.05b$ /cygdrive/c/cygnus/bin/cygcheck.exe -c
Cygwin Package Information
No setup information found

I do have it working now that I have fixed registry entries. Turns out
to be about 6M (tgz'd) with a database set up with the schema i want
the end user to see.

What program sets the registry entries up during cygwin install?

Thanks,
Todd

On Thu, 2 Jan 2003, Jason Tishler wrote:

> Todd,
>
> On Tue, Dec 31, 2002 at 12:42:34PM -0700, Todd F. Peterson wrote:
> > here's what i have so far for minimum files:
> > /cygmin
> >
> > /cygmin/bin
> > [snip]
> >
> > /cygmin/tmp
> >
> > /cygmin/usr/local/bin
> > [snip]
>
> Please post the output of cygcheck -c.  People are always asking, "What
> is the minimum required packages for proper Cygwin PostgreSQL operation."
>
> Thanks,
> Jason
>
> --
> PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
> Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6
>


Re: postgres on windows with minimal cygwin

From
Jason Tishler
Date:
Todd,

On Thu, Jan 02, 2003 at 12:08:49PM -0700, Todd F. Peterson wrote:
> Have built the cygmin by starting with empty directory and copying
> over files from my main cygwin install. setup information is not there
> so cygcheck produces:

I thought so, but it was worth asking.

> What program sets the registry entries up during cygwin install?

Cygwin's setup.exe, but you can use Cygwin's mount instead.  Note that I
use the following for my (non PostgreSQL) minimal installs:

    rem Set variables
    set CygwinDir=%1
    set PATH=%CygwinDir%\bin;%PATH%;

    rem Set mount points
    mount -f -s -b %CygwinDir% /
    mount -f -s -b %CygwinDir%\bin /usr/bin
    mount -f -s -b %CygwinDir%\lib /usr/lib
    mount -f -s -b -c /cygdrive

Jason

--
PGP/GPG Key: http://www.tishler.net/jason/pubkey.asc or key servers
Fingerprint: 7A73 1405 7F2B E669 C19D  8784 1AFD E4CC ECF4 8EF6