Re: Postgres postmaster

Поиск
Список
Период
Сортировка
От Michael Jinks
Тема Re: Postgres postmaster
Дата
Msg-id 3AA5A8B8.CC614DC3@saecos.com
обсуждение исходный текст
Ответ на Re: Postgres postmaster  (Bill <workshop@willysworkshop.com>)
Список pgsql-novice
Long-time RPM jockey about to chime in... There are all kinds of things
we can do to check the status of the postgres* packages, info here will
have little to do with postgresql generally but does come in handy if
you're using RPM's for anything.


GH wrote:

> find / -name postmaster
> which should find the 'postmaster' binary.
> (Someone please speak up if you know of a better way of ascertaining
> said location.)

Dunno about "better," but faster, and with other applications as well --

If it was installed from an rpm package you can do

rpm -ql <PackageTitle>

(pipe to grep or less, especially for large packages)

If you think the package may be screwed up somehow you can do

rpm -V <PackageTitle>

...for a list of the things that rpm sees as different than they were
when it installed the package (file sizes, MD5 checksums, and of course
altogether missing stuff are checked for)

If you can't remember the exact name of a package (in which case the
commands above will come back claiming that the package isn't present),
or in cases where a package might have several subcomponents or add-on
modules with similar names, you can do

rpm -qa | grep -i <whatever>

...which will kick back a list of titles suitable for use as arguments
to the above; for example

[mjinks@gaea mjinks]$ rpm -qa | grep -i postgres
postgresql-server-7.0.2-17    <--- necessary in addition to the "main"
package, by the way
postgresql-7.0.2-17
postgresql-devel-7.0.2-17     <--- possibly not necessary depending on
what else you're going to do



> 1) Find the location of your PostgreSQL installation.
> Usually, this is '/usr/local/pgsql' (at least, on FreeBSD).

For better or for worse, RPM's don't usually install anything under
/usr/local.  For example,

[mjinks@gaea mjinks]$ rpm -ql postgresql | grep bin
/usr/bin/createdb
/usr/bin/createlang
/usr/bin/createuser
/usr/bin/dropdb
/usr/bin/droplang
/usr/bin/dropuser
/usr/bin/pg_dump
/usr/bin/pg_dumpall
/usr/bin/pg_id
/usr/bin/psql
/usr/bin/vacuumdb
<snip>

> 2) Go to that directory and (as the PostgreSQL user on your system, which
> could be 'pgsql' or whatever) run `initdb` as per the instructions
> in the PostgreSQL documentation

The RPM's should in fact take care of this.  Well, more precisely I
think that they install initialization scripts which run inidb if they
detect that it hasn't happened yet -- at least mine have all done it
that way lately.

> 3) See if the rpm installed a startup script (in /usr/local/etc/rc.d
> under FreeBSD using the ports collection) in the standard rc location
> for your operating system. If it did, then (as root) try starting
> postmaster using the startup script in the customary way for your OS.

Again, yeah, this should be there, but not installed by the main
postgresql package:

[mjinks@gaea mjinks]$ rpm -ql postgresql-server | grep rc.d
/etc/rc.d/init.d/postgresql

--
Michael Jinks  mjinksATsysvi.com ~*~ http://www.yellow5.com/pokey/
unconfirmed: the linux penguin;the bsd daemon;the sunOS brain slug

В списке pgsql-novice по дате отправления:

Предыдущее
От: "Constantin"
Дата:
Сообщение: check for table existence before dropping
Следующее
От: Roland Roberts
Дата:
Сообщение: Re: [SQL] Permissons on database