Keith Christian schrieb:
I'd like to get PostgreSQL running on my Vista machine.
I've been following the "impatient" instructions at the end of
/usr/share/doc/Cygwin/postgresql-8.2.11.README as shown below:
1 Installation:
2
3 For the impatient: install as service (hard)
hard is really "hard"
4
5 # save old database (optional)
6 pg_dumpall -g /tmp/$$pgdump-globals.sql
7 pg_dumpall > /tmp/$$pgdump.sql
8 # adjust the settings in /etc/rc.d/init.d/postgresql
9 nano /etc/rc.d/init.d/postgresql
10 sysbash # /etc/rc.d/init.d/postgresql initdb
11 /etc/rc.d/init.d/postgresql install
12 /etc/rc.d/init.d/postgresql start
Below is a screen capture showing what transpired:
Tue Jan 27 06:04:36 (ke...@tycho) ~>rm -rf /usr/share/postgresql/data/
########## (Line 9 above) - What settings should be adjusted in
/etc/rc.d/init.d/postgresql for a starting Cygwin installation???
PGDATA, POSTMASTER_ARGS or INITDB_ARGS could be adjusted.
########## (Line 10 above) - What is the meaning of "sysbash?
A shell running as SYSTEM user. Google for it. There's no program to do
that automatically, just a trick to get "root" (SYSTEM user) access on
windows.
Tue Jan 27 06:06:04 (ke...@tycho) ~>/etc/rc.d/init.d/postgresql initdb
The files belonging to this database system will be owned by user "keith".
This user must also own the server process.
So you initialized the database as user keith and not as SYSTEM.
So the service must belong to use keith and not SYSTEM.
The database cluster will be initialized with locale C.
creating directory /usr/share/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 40
selecting default shared_buffers/max_fsm_pages ... 32MB/204800
creating configuration files ... ok
creating template1 database in /usr/share/postgresql/data/base/1 ... ok
initializing pg_authid ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
creating conversions ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.
Success. You can now start the database server using:
/usr/sbin/postgres -D /usr/share/postgresql/data (AAAAA)
or
/usr/sbin/pg_ctl -D /usr/share/postgresql/data -l logfile start (BBBBB)
done.
########## Confusion here - The previous lines at the end of initdb
(labeled AAAAA and BBBBB above) instruct the user to try one of two
command lines to start Postgres. In the README file there are two
lines following "initdb", one ending with "install" and the other
ending with "start." How should the user proceed at this point?
One of the three, preferred the one I gave in my instruction.
sysbash # (analog to sudo SYSTEM)
/etc/rc.d/init.d/postgresql initdb
/etc/rc.d/init.d/postgresql install
/etc/rc.d/init.d/postgresql start
But only the manual way to start the database will work because you
didn't install it as SYSTEM.
So either AAAAA or BBBBB
Tue Jan 27 06:10:26 (ke...@tycho) ~>echo $CYGWIN
ntsec binmode codepage:oem server tty
Tue Jan 27 06:10:30 (ke...@tycho) ~>/etc/rc.d/init.d/postgresql install
- cygserver OK - ERROR CYGWIN must contain server for cygserver to work properly
Hmm, this seems to be a script error on my side. Thanks.
########## Something wrong with the error message above - CYGWIN does
indeed contain "server", see above ^^^^^
Tue Jan 27 06:11:30 (ke...@tycho) ~>/etc/rc.d/init.d/postgresql start
Starting PostgreSQL: - cygserver OK - ERROR CYGWIN must contain server
for cygserver to work properly
Tue Jan 27 06:11:40 (ke...@tycho) ~>psql -U keith -d postgres
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
***************************************************
** SECTIONS OF POSTGRESQL'S LOGFILE APPEAR BELOW **
***************************************************
Tue Jan 27 06:13:51 (ke...@tycho) ~>ls -l logfile
-rw------- 1 keith None 297212 Jan 27 06:13 logfile
Tue Jan 27 06:13:55 (ke...@tycho) ~>cat -n logfile
1 LOG: database system was shut down at 2009-01-27 06:08:33 MST
2 LOG: checkpoint record is at 0/485AD0
3 LOG: redo record is at 0/485AD0; undo record is at 0/0; shutdown TRUE
4 LOG: next transaction ID: 0/593; next OID: 10820
5 LOG: next MultiXactId: 1; next MultiXactOffset: 0
6 LOG: database system is ready
7 3 [main] postgres 4352 _cygtls::handle_exceptions: Error
while dumping state (probably corrupt ed stack)
8 21805 [main] postgres 4352 _cygtls::handle_exceptions: Error
while dumping state (probably corrupt ed stack)
9 22208 [main] postgres 4352 _cygtls::handle_exceptions: Error
while dumping state (probably corrupt ed stack)
10 22543 [main] postgres 4352 _cygtls::handle_exceptions: Error
while dumping state (probably corrupt ed stack)
************************************
** LINES CLIPPED FROM LOG **
************************************
2696 1961785 [main] postgres 4352 _cygtls::handle_exceptions: Error
while dumping state (probably corrupt ed stack)
2697 1962167 [main] postgres 4352 _cygtls::handle_exceptions: Error
while dumping state (probably corrupt ed stack)
2698 1962554 [main] postgres 4352 _cygtls::handle_exceptions: Error
while dumping state (probably corrupt ed stack)
2699 19 [main] postgres 5624 fork: child 4352 - died waiting
for dll loading, errno 11
2700 LOG: could not fork background writer process: Resource
temporarily unavailable
2701 LOG: server process (PID 4352) exited with exit code 5
2702 LOG: terminating any other active server processes
2703 LOG: all server processes terminated; reinitializing
2704 LOG: database system was interrupted at 2009-01-27 06:13:41 MST
2705 LOG: checkpoint record is at 0/485AD0
2706 LOG: redo record is at 0/485AD0; undo record is at 0/0; shutdown TRUE
2707 LOG: next transaction ID: 0/593; next OID: 10820
2708 LOG: next MultiXactId: 1; next MultiXactOffset: 0
2709 LOG: database system was not properly shut down; automatic
recovery in progress
2710 LOG: record with zero length at 0/485B20
2711 LOG: redo is not required
2712 LOG: database system is ready
Tue Jan 27 06:14:00 (ke...@tycho) ~>psql -U keith -d postgres
psql: FATAL: role "keith" does not exist
Good, the database seems to be running nevertheless
What other steps should I take? What other information should I
provide to help troubleshoot this problem?
So your running it as keith.
Add the db and role keith.
$ createdb keith
$ createuser -S -R -d keith
--
Reini Urban
http://phpwiki.org/ http://murbreak.at/
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/