Connecting to PostGreSQL on same machine: Mac OSX

Frank D. Engel, Jr. fde101 at fjrhome.net
Mon Dec 13 14:20:43 EST 2004


Hmm.

The only non-comment lines in my pg_hba.conf are as follows:

# TYPE  DATABASE    USER        IP-ADDRESS        IP-MASK           
METHOD

local   all         all                                             
password
# IPv4-style local connections:
host    all         all         127.0.0.1         255.255.255.255   
password
# IPv6-style local connections:
host    all         all         ::1               
ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff        password

host    all         all         192.168.0.5       255.255.255.0     
password


My postgresql.conf is stock from the installer at 
http://www.entropy.ch/software/macosx/postgresql/, except for 
uncommenting the tcpip_socket option and setting it to true.

And this is working fine.

When modifying these files, did you check to ensure that you did not 
modify permissions on the files/folders up to that point without 
switching them back?  Wrong permissions on the data directory and its 
contents will cause postgres to abort startup.

You should be able to get results similar to these (watch the mode bits 
for the data dir and its contents; note that your results may vary 
slightly in other ways, and probably will):


Frank-Engels-Computer:/usr/local/pgsql root# ls -l
total 120
-rw-------   1 postgres  wheel    155 15 Nov 11:44 .bash_history
-rw-------   1 postgres  wheel    135 15 Nov 11:42 .psql_history
drwx------  12 postgres  wheel    408 13 Dec 08:16 data                 
          <--
drwxr-xr-x   3 postgres  wheel    102 15 Nov 11:31 doc
drwxr-xr-x  22 postgres  wheel    748 15 Nov 11:31 include
drwxr-xr-x  51 postgres  wheel   1734 15 Nov 11:31 lib
-rw-------   1 postgres  wheel  47761 13 Dec 08:16 logfile
-rw-------   1 postgres  wheel   1338 26 Nov 22:28 postgres.log
drwxr-xr-x  13 postgres  wheel    442 15 Nov 11:31 share
Frank-Engels-Computer:/usr/local/pgsql root# cd data/
Frank-Engels-Computer:/usr/local/pgsql/data root# ls -l
total 56
-rw-------   1 postgres  wheel     4 15 Nov 11:38 PG_VERSION
drwx------   6 postgres  wheel   204 15 Nov 11:44 base
drwx------  22 postgres  wheel   748 13 Dec 08:16 global
drwx------   3 postgres  wheel   102 15 Nov 11:38 pg_clog
-rw-------   1 postgres  wheel  3376 15 Nov 11:43 pg_hba.conf           
        <--
-rw-------   1 postgres  wheel  1441 15 Nov 11:38 pg_ident.conf
drwx------   5 postgres  wheel   170  6 Dec 17:42 pg_xlog
-rw-------   1 postgres  wheel  7777 15 Nov 11:43 postgresql.conf       
       <--
-rw-------   1 postgres  wheel    60 13 Dec 08:16 postmaster.opts
-rw-------   1 postgres  wheel    46 13 Dec 08:16 postmaster.pid
Frank-Engels-Computer:/usr/local/pgsql/data root#


On Dec 13, 2004, at 2:03 PM, Sivakatirswami wrote:

> More on this...
>
> I can start the dbase in the foreground..
>
> katir:~ postgres$ /usr/local/pgsql/bin/postmaster -D 
> /usr/local/pgsql/data
> LOG:  database system was shut down at 2004-12-13 08:56:00 HST
> LOG:  checkpoint record is at 0/9E0780
> LOG:  redo record is at 0/9E0780; undo record is at 0/0; shutdown TRUE
> LOG:  next transaction ID: 551; next OID: 17153
> LOG:  database system is ready
>
> I see three postgres processes now in the activity monitor... but I 
> can't find a way to issue commands to it from the cmd line.. there is 
> no prompt after the last line above.
>
>
>
>> but
>
>
>> katir:~ postgres$ /usr/local/pgsql/bin/pg_ctl -D 
>> /usr/local/pgsql/data -l logfile restart
>
> doesn't work.. see below.
>
>
>
> On Dec 13, 2004, at 8:45 AM, Sivakatirswami wrote:
>
>> Frank, thanks for your patient responses
>>
>> Still no go..
>>
>> katir:~ postgres$ /usr/local/pgsql/bin/pg_ctl -D 
>> /usr/local/pgsql/data -l logfile restart
>>
>> nothing happens, activity monitor doesn't show any start postgres 
>> processes started.
>>
>> So, I'm stumped at this moment.
>>
>> Is there some other log that will tell give us any useful feed back 
>> on what is happening.
>>
>> Pierre:  Yes, I suppose I could  do a complete re-install, but, since 
>> two days ago I *was* able to start the server and all that I did in 
>> the interim was to "touch" the pg_hba.conf and postgresql.conf files, 
>> I *really* would like to fix this "manually" so that I get a grip on 
>> the issues and not simply "quit" and start over again.  though, if 
>> there is no definitive diagnostic then I may have not choice...
>>
>>
>> In the meantime I'm logging into our new server in Connecticutt where 
>> Postgres is running just fine and going through the tutorials via 
>> ssh...  creating test data bases and doing my "homework." (I'll have 
>> more to ask you about the rev ap server you installed after I get a 
>> little deeper into it...)
>>
>> So, not having it running on my own machine is not a show stopper, 
>> just a nuisance.. normally I would be doing this kind of  R & D 
>> during hours when I am off line... now I have to do it during on-line 
>> hours= "eats my day job time." i.e. the time when I should be working 
>> on web design, content and team coordination etc.
>>
>> Pierre, perhaps you could email me off list your own pg_hba.conf and 
>> postgresql.conf files that you are using on your OSX machine, I would 
>> install those and see if it works
>>
>> Thanks!
>> Sivakatirswami
>> Himalayan Academy Publications
>> at Kauai's Hindu Monastery
>> katir at hindu.org
>>
>> www.HimalayanAcademy.com,
>> www.HinduismToday.com
>> www.Gurudeva.org
>> www.Hindu.org
>>
>> On Dec 13, 2004, at 7:18 AM, Frank D. Engel, Jr. wrote:
>>
>>> This is trying to connect to PostgreSQL through a UNIX domain socket 
>>> rather than TCP/IP.  This should still be working, but if not, try a 
>>> command like this:
>>>
>>> psql -h <hostname> -U <username> dbname
>>>
>>>
>>>>
>>>> So, no I cannot even start up the server at all.
>>>
>>> Did you check the activity monitor again to see if it was running or 
>>> not?  The above given error message is a connectivity problem, any 
>>> does not necessarily mean that the server is not running.
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
-----------------------------------------------------------
Frank D. Engel, Jr.  <fde101 at fjrhome.net>

$ ln -s /usr/share/kjvbible /usr/manual
$ true | cat /usr/manual | grep "John 3:16"
John 3:16 For God so loved the world, that he gave his only begotten 
Son, that whosoever believeth in him should not perish, but have 
everlasting life.
$



___________________________________________________________
$0 Web Hosting with up to 120MB web space, 1000 MB Transfer
10 Personalized POP and Web E-mail Accounts, and much more.
Signup at www.doteasy.com



More information about the use-livecode mailing list