Patch BUG #5103: "pg_ctl -w (re)start" fails with custom unix_socket_directory

Lists: pgsql-hackers
From: Quan Zongliang <quanzongliang(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Patch BUG #5103: "pg_ctl -w (re)start" fails with custom unix_socket_directory
Date: 2010-11-27 09:03:12
Message-ID: 20101127180312.6b0e3ead.quanzongliang@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi, all

I created a pg_ctl patch to fix:
* BUG #5103: "pg_ctl -w (re)start" fails with custom unix_socket_directory
Allow pg_ctl to work properly with configuration files located outside the PGDATA directory

I tested it under Windows XP sp3.
All of configuration files(postgresql.conf pg_hba.conf pg_ident.conf) are in c:\data,
and data_dir is in C:\Program Files\PostgreSQL\9.0\data

Check the attchment, please.

Another question, after clone source with git I can not compile them:
Bad format filename 'src\bin\scripts\submake-libpq'
Former makefile like "createdb: createdb.o ... keywords.o"
Now it is "createdb: createdb.o ... keywords.o | submake-libpq"
How to do this?

------------------------------------------
SEARCHING JOB. I can work on C/C++.

Quan Zongliang <quanzongliang(at)gmail(dot)com>

Attachment Content-Type Size
pg_ctl.diff text/plain 3.4 KB

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Quan Zongliang <quanzongliang(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch BUG #5103: "pg_ctl -w (re)start" fails with custom unix_socket_directory
Date: 2010-11-29 13:29:17
Message-ID: 1291037103-sup-2172@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Excerpts from Quan Zongliang's message of sáb nov 27 06:03:12 -0300 2010:
> Hi, all
>
> I created a pg_ctl patch to fix:
> * BUG #5103: "pg_ctl -w (re)start" fails with custom unix_socket_directory
> Allow pg_ctl to work properly with configuration files located outside the PGDATA directory

I think the way this should work is that you call postmaster with a new
switch and it prints out its configuration, after reading the
appropriate config file(s). That way it handles all the little details
such as figuring out the correct config file, hadle include files, etc.
This output would be presumably easier to parse and more trustworthy.

Right now we have --describe-config, which is missing the values for
each config option.

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Quan Zongliang <quanzongliang(at)gmail(dot)com>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch BUG #5103: "pg_ctl -w (re)start" fails with custom unix_socket_directory
Date: 2010-12-21 21:36:11
Message-ID: 20101222063611.b8698787.quanzongliang@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Mon, 29 Nov 2010 10:29:17 -0300
Alvaro Herrera <alvherre(at)commandprompt(dot)com> wrote:

> Excerpts from Quan Zongliang's message of sáb nov 27 06:03:12 -0300 2010:
> > Hi, all
> >
> > I created a pg_ctl patch to fix:
> > * BUG #5103: "pg_ctl -w (re)start" fails with custom unix_socket_directory
> > Allow pg_ctl to work properly with configuration files located outside the PGDATA directory
>
> I think the way this should work is that you call postmaster with a new
> switch and it prints out its configuration, after reading the
> appropriate config file(s). That way it handles all the little details
> such as figuring out the correct config file, hadle include files, etc.
> This output would be presumably easier to parse and more trustworthy.
>
> Right now we have --describe-config, which is missing the values for
> each config option.
>

Sorry for my late reply.

I will check the source of postmaster.

--
Quan Zongliang <quanzongliang(at)gmail(dot)com>


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Quan Zongliang <quanzongliang(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch BUG #5103: "pg_ctl -w (re)start" fails with custom unix_socket_directory
Date: 2010-12-22 01:24:12
Message-ID: 1292980985-sup-5269@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Excerpts from Quan Zongliang's message of mar dic 21 18:36:11 -0300 2010:
> On Mon, 29 Nov 2010 10:29:17 -0300
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> wrote:
>

> > I think the way this should work is that you call postmaster with a new
> > switch and it prints out its configuration, after reading the
> > appropriate config file(s). That way it handles all the little details
> > such as figuring out the correct config file, hadle include files, etc.
> > This output would be presumably easier to parse and more trustworthy.
>
> Sorry for my late reply.
>
> I will check the source of postmaster.

Actually Bruce Momjian is now working on a different fix:
unix_socket_directory would be added to postmaster.pid, allowing pg_ctl
to find it.

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Quan Zongliang <quanzongliang(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch BUG #5103: "pg_ctl -w (re)start" fails with custom unix_socket_directory
Date: 2010-12-23 02:02:35
Message-ID: 201012230202.oBN22Ze21097@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera wrote:
> Excerpts from Quan Zongliang's message of mar dic 21 18:36:11 -0300 2010:
> > On Mon, 29 Nov 2010 10:29:17 -0300
> > Alvaro Herrera <alvherre(at)commandprompt(dot)com> wrote:
> >
>
> > > I think the way this should work is that you call postmaster with a new
> > > switch and it prints out its configuration, after reading the
> > > appropriate config file(s). That way it handles all the little details
> > > such as figuring out the correct config file, hadle include files, etc.
> > > This output would be presumably easier to parse and more trustworthy.
> >
> > Sorry for my late reply.
> >
> > I will check the source of postmaster.
>
> Actually Bruce Momjian is now working on a different fix:
> unix_socket_directory would be added to postmaster.pid, allowing pg_ctl
> to find it.

Yes, I will apply this patch tomorrow and it will be in 9.1. Thanks for
the report.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +


From: Quan Zongliang <quanzongliang(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch BUG #5103: "pg_ctl -w (re)start" fails with custom unix_socket_directory
Date: 2010-12-23 14:26:29
Message-ID: 20101223232629.7239be91.quanzongliang@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Wed, 22 Dec 2010 21:02:35 -0500 (EST)
Bruce Momjian <bruce(at)momjian(dot)us> wrote:

> Alvaro Herrera wrote:
> > Excerpts from Quan Zongliang's message of mar dic 21 18:36:11 -0300 2010:
> > > On Mon, 29 Nov 2010 10:29:17 -0300
> > > Alvaro Herrera <alvherre(at)commandprompt(dot)com> wrote:
> > >
> >
> > > > I think the way this should work is that you call postmaster with a new
> > > > switch and it prints out its configuration, after reading the
> > > > appropriate config file(s). That way it handles all the little details
> > > > such as figuring out the correct config file, hadle include files, etc.
> > > > This output would be presumably easier to parse and more trustworthy.
> > >
> > > Sorry for my late reply.
> > >
> > > I will check the source of postmaster.
> >
> > Actually Bruce Momjian is now working on a different fix:
> > unix_socket_directory would be added to postmaster.pid, allowing pg_ctl
> > to find it.
>
> Yes, I will apply this patch tomorrow and it will be in 9.1. Thanks for
> the report.
>
Nice work.

--
Quan Zongliang <quanzongliang(at)gmail(dot)com>