Обсуждение: Postmaster running, psql not

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

Postmaster running, psql not

От
Roy MacGregor Paterson
Дата:
Hi guys and gals,

I'm a pgsql newbie, starting from scratch, can't get past second post: help.

Environment is like this...
MacOS X Jaguar
PowerBook G4
Installed PG v7.3.3 from Entropy package as per website instructions
Installed Aqua Studio GUI
Reading Practical PostgreSQL, O'Reilly
Reading Unix for MacOS X, O'Reilly
(typical mac user: can spell gui but not unix)

Am able to fire up pg in Terminal with...

/usr/local/bin/pg_ctl -D /usr/local/pgsql/data start
"postmaster successfully started"

and shut it down again with...

/usr/local/bin/pg_ctl -D /usr/local/pgsql/data stop -m smart
"postmaster successfully shut down"

(No environment variables set yet)

Directory looks like this...
[MacGregor:/usr] postgres% ls /usr/local/bin
bdftops             gsbj                pg_config           postmaster
clusterdb           gsdj                pg_controldata      printafm
createdb            gsdj500             pg_ctl              ps2ascii
createlang          gslj                pg_dump             ps2epsi
createuser          gslp                pg_dumpall          ps2pdf
dropdb              gsnd                pg_encoding         ps2pdf12
droplang            initdb              pg_id               ps2pdf13
dropuser            initlocation        pg_resetxlog        ps2pdfwr
dvipdf              ipcclean            pg_restore          ps2ps
ecpg                lprsetup.sh         pgtclsh             psql
eps2eps             pdf2dsc             pj-gs.sh            pv.sh
fixmswrd.pl         pdf2ps              pltcl_delmod        sysvlp.sh
font2c              pdfopt              pltcl_listmod       unix-lpr.sh
gimpprint-config    pf2afm              pltcl_loadmod       vacuumdb
gs                  pfbtopfa            postgres            wftopfa


OK. So it looks like psql is installed, but when I enter the
connection command so that I can call createdb...
[MacGregor:~] postgres% psql -U manager template1 (straight from the book)

I get...
psql: Command not found.

Also tried to connect via Acqua Studio GUI: Register Server but it
wouldn't connect: "...is TCP/IP set up?...". Which is standard in the
Entropy pkg I believe. Not really sure what to enter as params for
PGSQL anyway.

Doh! what now? Anyone around in West London UK care to swap knowledge
for alcohol?

MTIA,
Roy
--
--------------------
Roy MacGregor Paterson
MacGregorTech

t: +44 (0) 20 7584 7891
f: +44 (0) 20 7589 6223
m: +44 (0) 7803 163 938
w: www.macgregortech.com
e: roy@macgregortech.com
--------------------

Postmaster running, psql not SOLVED

От
Roy MacGregor Paterson
Дата:
Thanks for the responses on this issue.

Now up and running, errrr staggering, with PG on MacOS X.

The problem with connecting to Acqua Studio was solved by searching
the PG archives.

In the standard Entropy/Mac OS X build, allowing connections via
TCP/IP is switched off, and the PG documentation is not at all clear
on how to invoke the option. Merely using -i, as implied, doesn't
work in the command-line, as a few other frustrated newbies have
discovered.

Firstly, you have to precede the TCP/IP option -i with the Option
option -o, to tell pg_ctl that you are using options. This does seem
slightly perverse to me.

Secondly, you have to enclose the TCP/IP option in single quotes.

Thirdly, you have to put these options in the correct place relative
to the start command.

This gets you going...

/usr/local/bin/pg_ctl -D /usr/local/pgsql/data -o '-i' start

...or...

pg_ctl -o '-i' start

...once you get the hang of environment variables (see my other postings).

Alternatively, the build setting itself, in the file postgresql.conf,
could be changed from tcpip_socket = false to tcpip_socket = true.

Roy
--
--------------------
Roy MacGregor Paterson
MacGregorTech

t: +44 (0) 20 7584 7891
f: +44 (0) 20 7589 6223
m: +44 (0) 7803 163 938
w: www.macgregortech.com
e: roy@macgregortech.com
--------------------