pg_ctl idempotent option
Here is a patch to add an option -I/--idempotent to pg_ctl, the result
of which is that pg_ctl doesn't error on start or stop if the server is
already running or already stopped.
The previous discussion was at
</messages/by-id/1253165415.18853.32.camel@vanquo.pezone.net>.
Attachments:
pg-ctl-idempotent.patchtext/x-patch; charset=UTF-8; name=pg-ctl-idempotent.patchDownload+50-11
Peter Eisentraut <peter_e@gmx.net> writes:
Here is a patch to add an option -I/--idempotent to pg_ctl, the result
of which is that pg_ctl doesn't error on start or stop if the server is
already running or already stopped.
Idempotent is a ten-dollar word. Can we find something that average
people wouldn't need to consult a dictionary to understand?
Also, should the option affect *only* the result code as you have it,
or should it also change the printed messages to reflect that the
case is considered expected?
Also it appears to me that the hunk at lines 812ff is changing the
default behavior, which is not what the patch is advertised to do.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Tom Lane wrote:
Peter Eisentraut <peter_e@gmx.net> writes:
Here is a patch to add an option -I/--idempotent to pg_ctl, the result
of which is that pg_ctl doesn't error on start or stop if the server is
already running or already stopped.Idempotent is a ten-dollar word. Can we find something that average
people wouldn't need to consult a dictionary to understand?
--no-error perhaps?
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
Tom Lane wrote:
Peter Eisentraut <peter_e@gmx.net> writes:
Here is a patch to add an option -I/--idempotent to pg_ctl, the result
of which is that pg_ctl doesn't error on start or stop if the server is
already running or already stopped.
Idempotent is a ten-dollar word. Can we find something that average
people wouldn't need to consult a dictionary to understand?
--no-error perhaps?
Meh, that's probably going too far in the direction of imprecision.
The point of this patch is that only very specific errors are
suppressed.
I don't have a better idea though. It'd be easier if there were
separate switches for the two cases, then you could call them
--ok-if-running and --ok-if-stopped. But that's not very workable,
if only because both would want the same single-letter abbreviation.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On 14 January 2013 15:29, Alvaro Herrera <alvherre@2ndquadrant.com> wrote:
Tom Lane wrote:
Peter Eisentraut <peter_e@gmx.net> writes:
Here is a patch to add an option -I/--idempotent to pg_ctl, the result
of which is that pg_ctl doesn't error on start or stop if the server is
already running or already stopped.Idempotent is a ten-dollar word. Can we find something that average
people wouldn't need to consult a dictionary to understand?--no-error perhaps?
Couldn't that be misconstrued as to suppress any type of error?
I personally can't think of something terse enough to put into a
descriptive long-word option that would adequately describe the change in
behaviour it provides.
--suppress-error-when-target-status-already-present ... bit too wordy. ;)
--
Thom
2013-01-14 16:22 keltezéssel, Tom Lane írta:
Peter Eisentraut <peter_e@gmx.net> writes:
Here is a patch to add an option -I/--idempotent to pg_ctl, the result
of which is that pg_ctl doesn't error on start or stop if the server is
already running or already stopped.Idempotent is a ten-dollar word. Can we find something that average
people wouldn't need to consult a dictionary to understand?
--do-nothing-if-same-state?
Also, should the option affect *only* the result code as you have it,
or should it also change the printed messages to reflect that the
case is considered expected?Also it appears to me that the hunk at lines 812ff is changing the
default behavior, which is not what the patch is advertised to do.regards, tom lane
--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
http://www.postgresql.at/
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
2013/1/14 Tom Lane <tgl@sss.pgh.pa.us>:
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
Tom Lane wrote:
Peter Eisentraut <peter_e@gmx.net> writes:
Here is a patch to add an option -I/--idempotent to pg_ctl, the result
of which is that pg_ctl doesn't error on start or stop if the server is
already running or already stopped.Idempotent is a ten-dollar word. Can we find something that average
people wouldn't need to consult a dictionary to understand?--no-error perhaps?
Meh, that's probably going too far in the direction of imprecision.
The point of this patch is that only very specific errors are
suppressed.I don't have a better idea though. It'd be easier if there were
separate switches for the two cases, then you could call them
--ok-if-running and --ok-if-stopped. But that's not very workable,
if only because both would want the same single-letter abbreviation.
--ignore-status
--ignore-status-start
--ignore-status-stop
?
Regards
--
Dickson S. Guedes
mail/xmpp: guedes@guedesoft.net - skype: guediz
http://guedesoft.net - http://www.postgresql.org.br
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Mon, Jan 14, 2013 at 4:22 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Peter Eisentraut <peter_e@gmx.net> writes:
Here is a patch to add an option -I/--idempotent to pg_ctl, the result
of which is that pg_ctl doesn't error on start or stop if the server is
already running or already stopped.Idempotent is a ten-dollar word. Can we find something that average
people wouldn't need to consult a dictionary to understand?
I disagree that we should dumb things down when the word means exactly what
we want and based on the rest of this thread is the only word or word
cluster that carries the desired meaning.
I vote to keep --idempotent.
Vik
Vik Reykja escribió:
On Mon, Jan 14, 2013 at 4:22 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Peter Eisentraut <peter_e@gmx.net> writes:
Here is a patch to add an option -I/--idempotent to pg_ctl, the result
of which is that pg_ctl doesn't error on start or stop if the server is
already running or already stopped.Idempotent is a ten-dollar word. Can we find something that average
people wouldn't need to consult a dictionary to understand?I disagree that we should dumb things down when the word means exactly what
we want and based on the rest of this thread is the only word or word
cluster that carries the desired meaning.I vote to keep --idempotent.
Yeah, after seeing the alternatives, I agree that it seems okay,
particularly given that the --help output explains the behavior in
dime-a-dozen words.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
Vik Reykja escribi�:
On Mon, Jan 14, 2013 at 4:22 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Idempotent is a ten-dollar word. Can we find something that average
people wouldn't need to consult a dictionary to understand?
I disagree that we should dumb things down when the word means exactly what
we want and based on the rest of this thread is the only word or word
cluster that carries the desired meaning.
I'm not quite convinced that it means *exactly* what we want. The
dictionary definition, according to my laptop's dictionary, is "denoting
an element of a set that is unchanged in value when multiplied or
otherwise operated on by itself". I'm well aware that computer people
often use it to mean "an operation that doesn't change the system state
if the state is already what's wanted", but I think that's probably an
abuse of the mathematical usage. And in any case, I'm not sure that
non-hackers would immediately recognize the term, nor be enlightened by
their dictionaries. But ...
Yeah, after seeing the alternatives, I agree that it seems okay,
... I was only asking if we *could* find a better choice. Seems we
can't, so let's stick with this.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On 1/14/13 10:22 AM, Tom Lane wrote:
Also it appears to me that the hunk at lines 812ff is changing the
default behavior, which is not what the patch is advertised to do.
True, I had forgotten to mention that.
Since it's already the behavior for start, another option would be to
just make it the default for stop as well and forget about the extra
options. I'm not sure whether there is a big use case for getting an
error code on stop if the server is already stopped.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On 1/14/13 10:22 AM, Tom Lane wrote:
Idempotent is a ten-dollar word. Can we find something that average
people wouldn't need to consult a dictionary to understand?
My suggestion in the original thread was --oknodo, but people didn't
like that either.
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
On 1/14/13 10:22 AM, Tom Lane wrote:
Also it appears to me that the hunk at lines 812ff is changing the
default behavior, which is not what the patch is advertised to do.
True, I had forgotten to mention that.
Since it's already the behavior for start, another option would be to
just make it the default for stop as well and forget about the extra
options. I'm not sure whether there is a big use case for getting an
error code on stop if the server is already stopped.
Actually, I seem to recall having had to hack Red Hat's initscript
because the LSB standard requires that stopping a not-running server
*not* be an error. So +1 for forgetting about the option entirely
and just making it idempotent all the time.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Tue, Jan 15, 2013 at 10:25:23AM -0500, Tom Lane wrote:
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
Vik Reykja escribi�:
On Mon, Jan 14, 2013 at 4:22 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Idempotent is a ten-dollar word. Can we find something that average
people wouldn't need to consult a dictionary to understand?I disagree that we should dumb things down when the word means exactly what
we want and based on the rest of this thread is the only word or word
cluster that carries the desired meaning.I'm not quite convinced that it means *exactly* what we want. The
dictionary definition, according to my laptop's dictionary, is "denoting
an element of a set that is unchanged in value when multiplied or
otherwise operated on by itself". I'm well aware that computer people
often use it to mean "an operation that doesn't change the system state
if the state is already what's wanted", but I think that's probably an
abuse of the mathematical usage. And in any case, I'm not sure that
non-hackers would immediately recognize the term, nor be enlightened by
their dictionaries. But ...
I have heard idempotent used several times by our folks, and I didn't
know what it meant either. I figured it was a "strong item". ;-) I
just looked it up.
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Tue, Jan 15, 2013 at 10:55:41AM -0500, Peter Eisentraut wrote:
On 1/14/13 10:22 AM, Tom Lane wrote:
Idempotent is a ten-dollar word. Can we find something that average
people wouldn't need to consult a dictionary to understand?My suggestion in the original thread was --oknodo, but people didn't
like that either.
That's Japanese for idempotent. ;-) LOL
--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
2013-01-15 20:28 keltezéssel, Bruce Momjian írta:
On Tue, Jan 15, 2013 at 10:25:23AM -0500, Tom Lane wrote:
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
Vik Reykja escribi�:
On Mon, Jan 14, 2013 at 4:22 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Idempotent is a ten-dollar word. Can we find something that average
people wouldn't need to consult a dictionary to understand?I disagree that we should dumb things down when the word means exactly what
we want and based on the rest of this thread is the only word or word
cluster that carries the desired meaning.I'm not quite convinced that it means *exactly* what we want. The
dictionary definition, according to my laptop's dictionary, is "denoting
an element of a set that is unchanged in value when multiplied or
otherwise operated on by itself". I'm well aware that computer people
often use it to mean "an operation that doesn't change the system state
if the state is already what's wanted", but I think that's probably an
abuse of the mathematical usage. And in any case, I'm not sure that
non-hackers would immediately recognize the term, nor be enlightened by
their dictionaries. But ...I have heard idempotent used several times by our folks, and I didn't
know what it meant either. I figured it was a "strong item". ;-) I
just looked it up.
The math term used in Hungarian for idempotent is mirror translated
to "leave it in place". The term also has a slang usage for beating somebody up. ;-)
--
----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26
A-2700 Wiener Neustadt, Austria
Web: http://www.postgresql-support.de
http://www.postgresql.at/
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On 01/15/2013 07:55 AM, Peter Eisentraut wrote:
On 1/14/13 10:22 AM, Tom Lane wrote:
Idempotent is a ten-dollar word. Can we find something that average
people wouldn't need to consult a dictionary to understand?My suggestion in the original thread was --oknodo, but people didn't
like that either.
I'm pretty sure that Oknodo is an island in the Pacific. ;-)
I don't have a better idea for a name, though.
--
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Wed, Jan 16, 2013 at 4:29 AM, Bruce Momjian <bruce@momjian.us> wrote:
That's Japanese for idempotent. ;-) LOL
+1.
--
Michael Paquier
http://michael.otacoo.com
On Tue, Jan 15, 2013 at 11:06 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Peter Eisentraut <peter_e@gmx.net> writes:
On 1/14/13 10:22 AM, Tom Lane wrote:
Also it appears to me that the hunk at lines 812ff is changing the
default behavior, which is not what the patch is advertised to do.True, I had forgotten to mention that.
Since it's already the behavior for start, another option would be to
just make it the default for stop as well and forget about the extra
options. I'm not sure whether there is a big use case for getting an
error code on stop if the server is already stopped.Actually, I seem to recall having had to hack Red Hat's initscript
because the LSB standard requires that stopping a not-running server
*not* be an error. So +1 for forgetting about the option entirely
and just making it idempotent all the time.
+1
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
On Fri, Jan 18, 2013 at 8:48 PM, Phil Sorber <phil@omniti.com> wrote:
+1
Is there more work being done on this, or is the current patch ready to review?
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers