[GENERAL] pg_ctl with unix domain socket?

2009-09-01 Thread Josef Wolf
Hello,

I have created a fresh cluster with

   initdb -D /some/path/pgtest

I can start postgres to run on unix domain socket serving this cluster with:

   postgres -D /some/path/pgtest -h '' -k /some/path/pgtest

But I'd like to use pg_ctl instead, in order to have clean control:

   PGPORT=/some/path/pgtest pg_ctl -D/some/path/pgtest -l postgreslog start


Any hints how to use pg_ctl to start/stop postgresql on a unix domain socket?

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] pg_ctl with unix domain socket?

2009-09-01 Thread Josef Wolf
On Tue, Sep 01, 2009 at 05:28:46PM +0530, Abbas wrote:
> On Tue, Sep 1, 2009 at 4:58 PM, Josef Wolf  wrote:

Thanks for your fast response, Abbas!

> > I have created a fresh cluster with
> >   initdb -D /some/path/pgtest
> >   PGPORT=/some/path/pgtest pg_ctl -D/some/path/pgtest -l postgreslog start
>
> PGPORT should be the port number on which the Postgresql server is
> running(5432 is default), and  PGDATA=some/path/pgtest .

Yeah, I see.  But I do not want it to bind to network socket.  I want it to
bind to a unix domain socket  _only_.

While all other postgres commands accept an absolute path as port
specification, meaning to use a unix domain socket, pg_ctl seems to behave
differently.

e.g: I can start postgres on a unix domain socket _only_ with following
parameters:

   postgres -D /some/path/pgtest -h '' -k /some/path/pgtest

But pg_ctl don't seem to have an option to do the same.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] pg_ctl with unix domain socket?

2009-09-01 Thread Josef Wolf
On Tue, Sep 01, 2009 at 06:34:21AM -0700, Adrian Klaver wrote:
> On Tuesday 01 September 2009 4:28:22 am Josef Wolf wrote:

Thanks for your help, Adrian!

[ ... ]
> > Any hints how to use pg_ctl to start/stop postgresql on a unix domain
> > socket?
> 
> 1) In postgresql.conf make listen_addresses empty per instructions:

I could get it running with putting listen_addresses='' in postgresql.conf
and then running

pg_ctl -Ddb -o "-h '' -k `pwd`/db" -l postgreslog start

pg_ctl -Ddb -o "-h '' -k `pwd`/db" -l postgreslog stop

Thanks to all who helped

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] pg_ctl with unix domain socket?

2009-09-03 Thread Josef Wolf
On Tue, Sep 01, 2009 at 04:47:25PM +0200, Josef Wolf wrote:
> On Tue, Sep 01, 2009 at 06:34:21AM -0700, Adrian Klaver wrote:
> > On Tuesday 01 September 2009 4:28:22 am Josef Wolf wrote:
> [ ... ]
> > > Any hints how to use pg_ctl to start/stop postgresql on a unix domain
> > > socket?
> > 1) In postgresql.conf make listen_addresses empty per instructions:
> I could get it running with putting listen_addresses='' in postgresql.conf
> and then running

BTW: it works fine without the listen_address='' setting in postgresql.conf

> pg_ctl -Ddb -o "-h '' -k `pwd`/db" -l postgreslog start

This works, but when I add the -w option, it waits all the 60 seconds. So
for some reason, pg_ctl does not notice that postgres is ready to accept
connections. This problem seems to happen only when starting. Stopping works
immediately.

Any ideas?

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] pg_ctl with unix domain socket?

2009-09-06 Thread Josef Wolf
On Fri, Sep 04, 2009 at 01:33:06PM -0400, Tom Lane wrote:
> Josef Wolf  writes:
> >> pg_ctl -Ddb -o "-h '' -k `pwd`/db" -l postgreslog start
> 
> > This works, but when I add the -w option, it waits all the 60 seconds.
> 
> I don't believe pg_ctl is smart enough to dredge the -k option out of -o
> and figure out that it has to look there for the socket.
> 
> In general I'd advise against using -k, as that will break nearly all
> clients not only pg_ctl.  If you need to put the socket in a nonstandard
> place, it's most convenient to wire the knowledge into libpq by changing
> DEFAULT_PGSOCKET_DIR at build time.  AFAIR that requires manually
> editing pg_config_manual.h.

Ugh, but how to configure it at runtime, then?

The goal I want to achieve is to get testing/development environments for
rails with postgres relative to the working copy of the checked out
directory.  Not having this relative prevents multiple working copies
to run tests in parallel because they all would use the same database.


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general