Re: [HACKERS] pg_ctl status with nonexistent data directory

2014-03-08 Thread Bruce Momjian
On Sat, Mar 8, 2014 at 09:08:31AM +0530, Amit Kapila wrote: On Fri, Mar 7, 2014 at 7:59 PM, Bruce Momjian br...@momjian.us wrote: On Fri, Mar 7, 2014 at 07:18:04PM +0530, Amit Kapila wrote: OK, done with the attached patch Three is returned for status, but one for other cases. I

Re: [HACKERS] pg_ctl status with nonexistent data directory

2014-03-07 Thread Amit Kapila
On Fri, Mar 7, 2014 at 9:41 AM, Bruce Momjian br...@momjian.us wrote: On Fri, Mar 7, 2014 at 09:07:24AM +0530, Amit Kapila wrote: One reason could be that as we are already returning special exit code for 'status' option of pg_ctl (exit(3)), this seems to be inline with it as this also get

Re: [HACKERS] pg_ctl status with nonexistent data directory

2014-03-07 Thread Bruce Momjian
On Fri, Mar 7, 2014 at 07:18:04PM +0530, Amit Kapila wrote: OK, done with the attached patch Three is returned for status, but one for other cases. I think it would have been better if it return status as 4 for cases where directory/file is not accessible (current new cases added by this

Re: [HACKERS] pg_ctl status with nonexistent data directory

2014-03-07 Thread Amit Kapila
On Fri, Mar 7, 2014 at 7:59 PM, Bruce Momjian br...@momjian.us wrote: On Fri, Mar 7, 2014 at 07:18:04PM +0530, Amit Kapila wrote: OK, done with the attached patch Three is returned for status, but one for other cases. I think it would have been better if it return status as 4 for cases

Re: [HACKERS] pg_ctl status with nonexistent data directory

2014-03-06 Thread Bruce Momjian
On Thu, Mar 6, 2014 at 09:54:57AM +0530, Amit Kapila wrote: If they haven't passed us a data directory, we don't really know if the server is running or not, so the patch just returns '1'. But for such cases, isn't the status 4 more appropriate? As per above link 4 program or service

Re: [HACKERS] pg_ctl status with nonexistent data directory

2014-03-06 Thread Florian Pflug
On Mar6, 2014, at 00:08 , Bruce Momjian br...@momjian.us wrote: I have addressed this issue with the attached patch: $ pg_ctl -D /lkjasdf status pg_ctl: directory /lkjasdf does not exist $ pg_ctl -D / status pg_ctl: directory / is not a database cluster directory

Re: [HACKERS] pg_ctl status with nonexistent data directory

2014-03-06 Thread Alvaro Herrera
Bruce Momjian escribió: Technically, you are right, but I tried a while ago to assign meaningful values to all the exit locations and the community feedback I got was that we didn't want that. That sounds odd. Do you have a link? -- Álvaro Herrerahttp://www.2ndQuadrant.com/

Re: [HACKERS] pg_ctl status with nonexistent data directory

2014-03-06 Thread Tom Lane
Alvaro Herrera alvhe...@2ndquadrant.com writes: Bruce Momjian escribió: Technically, you are right, but I tried a while ago to assign meaningful values to all the exit locations and the community feedback I got was that we didn't want that. That sounds odd. Do you have a link? FWIW, I

Re: [HACKERS] pg_ctl status with nonexistent data directory

2014-03-06 Thread Bruce Momjian
On Thu, Mar 6, 2014 at 12:17:55PM -0300, Alvaro Herrera wrote: Bruce Momjian escribió: Technically, you are right, but I tried a while ago to assign meaningful values to all the exit locations and the community feedback I got was that we didn't want that. That sounds odd. Do you have

Re: [HACKERS] pg_ctl status with nonexistent data directory

2014-03-06 Thread Amit Kapila
On Thu, Mar 6, 2014 at 7:46 PM, Bruce Momjian br...@momjian.us wrote: On Thu, Mar 6, 2014 at 09:54:57AM +0530, Amit Kapila wrote: If they haven't passed us a data directory, we don't really know if the server is running or not, so the patch just returns '1'. But for such cases, isn't the

Re: [HACKERS] pg_ctl status with nonexistent data directory

2014-03-06 Thread Tom Lane
Bruce Momjian br...@momjian.us writes: On Thu, Mar 6, 2014 at 12:17:55PM -0300, Alvaro Herrera wrote: Bruce Momjian escribió: Technically, you are right, but I tried a while ago to assign meaningful values to all the exit locations and the community feedback I got was that we didn't want

Re: [HACKERS] pg_ctl status with nonexistent data directory

2014-03-06 Thread Bruce Momjian
On Thu, Mar 6, 2014 at 10:43:01PM -0500, Tom Lane wrote: Bruce Momjian br...@momjian.us writes: On Thu, Mar 6, 2014 at 12:17:55PM -0300, Alvaro Herrera wrote: Bruce Momjian escribi�: Technically, you are right, but I tried a while ago to assign meaningful values to all the exit

Re: [HACKERS] pg_ctl status with nonexistent data directory

2014-03-06 Thread Bruce Momjian
On Fri, Mar 7, 2014 at 09:07:24AM +0530, Amit Kapila wrote: One reason could be that as we are already returning special exit code for 'status' option of pg_ctl (exit(3)), this seems to be inline with it as this also get called during status command. Also in the link sent by you in

Re: [HACKERS] pg_ctl status with nonexistent data directory

2014-03-05 Thread Bruce Momjian
On Mon, Nov 4, 2013 at 11:31:30AM -0500, Robert Haas wrote: On Sat, Nov 2, 2013 at 3:32 PM, Peter Eisentraut pete...@gmx.net wrote: This doesn't seem right: $ pg_ctl -D /nowhere status pg_ctl: no server running It does exit with status 3, so it's not all that broken, but I think the

Re: [HACKERS] pg_ctl status with nonexistent data directory

2014-03-05 Thread Amit Kapila
On Thu, Mar 6, 2014 at 4:38 AM, Bruce Momjian br...@momjian.us wrote: On Mon, Nov 4, 2013 at 11:31:30AM -0500, Robert Haas wrote: On Sat, Nov 2, 2013 at 3:32 PM, Peter Eisentraut pete...@gmx.net wrote: This doesn't seem right: $ pg_ctl -D /nowhere status pg_ctl: no server running It

Re: [HACKERS] pg_ctl status with nonexistent data directory

2013-11-04 Thread Robert Haas
On Sat, Nov 2, 2013 at 3:32 PM, Peter Eisentraut pete...@gmx.net wrote: This doesn't seem right: $ pg_ctl -D /nowhere status pg_ctl: no server running It does exit with status 3, so it's not all that broken, but I think the error message could be more accurate. I doubt anyone will object

[HACKERS] pg_ctl status with nonexistent data directory

2013-11-02 Thread Peter Eisentraut
This doesn't seem right: $ pg_ctl -D /nowhere status pg_ctl: no server running It does exit with status 3, so it's not all that broken, but I think the error message could be more accurate. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your