Patch for text of HOWTO entitled "How to install PostgreSQL on Windows"

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

Patch for text of HOWTO entitled "How to install PostgreSQL on Windows"

От:
PaulBowman@HBOSplc.com
Дата:
Вложения:
 <> 

Basically the current version on  Postgres that comes with Cygwin also seems to have a dependency on the crypt library (it kept falling over with a message about missing dll with a name LIKE '%crypt%' - I guessed on the crypt lib and that seemed to cure it OK. BTW failed to book-mark exactly which page text appears on - ask for full text if you can't identify it from title.

Currently I now have an instance running according to Cygwin - only problem is I can't seem to psql to it from anywhere (tried opening a second Cygwin window and...

****
$ psql -l
psql: could not connect to server: Connection refused
        Is the server running on host "localhost" and accepting
        TCP/IP connections on port 5432?

****

Any tips would be appreciated.

cheers,

Paul Bowman
Database Services
Service Delivery
Group Technology
HBOS Group Services
Desk			0113 23 (53696)
Mobile			07880 784415

Team Mailbox		$IT SD  Oracle/SQL Server
Team Helpline		0113 23 (53201)
group services - delivering for HBOS


-- 

------------------------------------------------------------------------------
HBOS plc, Registered in Scotland No. SC218813. Registered Office: The Mound, Edinburgh EH1 1YZ. HBOS plc is a holding company, subsidiaries of which are regulated by the Financial Services Authority.
==============================================================================

Re: Patch for text of HOWTO entitled "How to install PostgreSQL

От:
Frank Seesink <frank@mail.wvnet.edu>
Дата:
Paul,

PostgreSQL's dependency on 'crypt', like answers to many install 
questions related to Cygwin, is well known...and well documented in a 
file that's installed in Cygwin at

/usr/share/doc/Cygwin/postgresql-7.x.README

If you read that document, or the online version thereof, at

http://www.tishler.net/jason/software/postgresql/

it may help.  Jason's done a great job helping more people get up and 
running under Cygwin (myself included), and his writeup can save you 
some headaches.

In fact, crypt is the very first package listed as being "required to 
build and/or execute Cygwin PostgreSQL" in his README.  Just FYI.

As for your second issue, read the error message.  It indicates that 
psql (the client program) doesn't get an answer when it tries to do a 
TCP/IP connection (to the postmaster server).  Normally this is due to 
not running 'postmaster' with the appropriate switches or the proper 
config.  Assuming you followed Jason's README and are using the latest 
version of PostgreSQL (7.4.1-3 as I write this), your data store is in 
/var/postgresql/data.  Check and READ through the following files in 
that directory:

pg_hba.conf      == controls who can access postmaster
postgresql.conf  == PostgreSQL config file (where you specify things
                     like how postmaster "listens", as in via local
                     sockets and/or via TCP/IP)

and make sure you understand what they do.  Most likely you will need to 
adjust them in order to get what you want.  For example, by default 
PostgreSQL will not listen for incoming TCP/IP connections.  You need to 
  set

	tcpip_socket = true

in postgresql.conf, and then you need to make sure you you have 
pg_hba.conf set correctly to allow through who should get through and 
deny who should not.

If you don't have a book (online version or dead tree variety) on 
PostgreSQL, I suggest you get one.  I found Bruce Momjian's book, 
'PostgreSQL: Introduction and Concepts'

http://www.amazon.com/exec/obidos/tg/detail/-/0201703319/qid=1077163377/sr=1-1/ref=sr_1_1/002-4665371-3488024?v=glance&s=books

indispensible when I first started working with PostgreSQL (and the fact 
Bruce is one of the core developers doesn't hurt).  Of course, your 
mileage may vary, but there are several books out there now:

	http://www.postgresql.org/users-lounge/books.html

There's also the online docs at

	http://www.postgresql.org/docs

As a quick note, whenever I setup PostgreSQL, the first thing I do is 
the most basic of connections.  Instead of firing off psql with '-l' 
"from anywhere", I first try using psql on the SAME box that the 
postmaster process is running on, and I try a simple connection using

	psql -U postgres template1

The -U is to force the username to be the only one that initially exists 
in a newly minted PostgreSQL data store (and the one you can usually 
guarantee exists), because without this, psql will take your currently 
logged in username.  I also specify the template1 db as it's the only 
one that exists as well (and again, you can count on it being there).

This connection also is done internally via sockets, as opposed to 
attempting a TCP/IP connection, so if it fails, odds are I've really 
mucked things up.  Once this works, I then try a connection via TCP/IP 
using a test like

	psql -h localhost -U postgres template1

again, from the same box that postmaster is running on.

Once I can connect via the loopback address, I try the actual 
IP/hostname of the box in place of 'localhost'.  And only then do I try 
from another machine.  If at any stage the test fails, I start looking 
at the appropriate files mentioned above, as short of 'postmaster' not 
running (which I also check in the Windows Task Manager), this is where 
you can almost guaranteed find your problem.  I also type commands like 
'netstat -an' to see whether TCP port 5432 is in use (which indicates a 
process is listening on that port, which hopefully is 'postmaster' as 
this is the standard port for PostgreSQL).

Well, hope that helps.  If you still can't get things working, please 
write back with more specific details on your setup (version of Cygwin, 
PostgreSQL, Windows, etc.), the more the better.  When asking someone to 
help you troubleshoot, it's always best to describe your configuration 
in as much detail as possible, as the more facts people have, the better 
the chance of resolving the problem.


 >PaulBowman@HBOSplc.com wrote:
>  <> 
> 
> Basically the current version on  Postgres that comes with Cygwin also seems to have a dependency on the crypt library (it kept falling over with a message about missing dll with a name LIKE '%crypt%' - I guessed on the crypt lib and that seemed to cure it OK. BTW failed to book-mark exactly which page text appears on - ask for full text if you can't identify it from title.
> 
> Currently I now have an instance running according to Cygwin - only problem is I can't seem to psql to it from anywhere (tried opening a second Cygwin window and...
> 
> ****
> $ psql -l
> psql: could not connect to server: Connection refused
>         Is the server running on host "localhost" and accepting
>         TCP/IP connections on port 5432?
> 
> ****
> 
> Any tips would be appreciated.
> 
> cheers,
> 
> Paul Bowman
> Database Services
> Service Delivery
> Group Technology
> HBOS Group Services
> Desk			0113 23 (53696)
> Mobile			07880 784415
> 
> Team Mailbox		$IT SD  Oracle/SQL Server
> Team Helpline		0113 23 (53201)
> group services - delivering for HBOS
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
FAQ