pg_upgrade: allow multiple -o/-O options

Started by Pavel Raiskupabout 12 years ago5 messageshackers
Jump to latest
#1Pavel Raiskup
praiskup@redhat.com

Hello,

RFE: Consider that you want to run pg_upgrade via some script with some
default '-o' option. But then you also want to give the script's user a
chance to specify the old-server's options according user's needs.
Then something like the following is not possible:

$ cat script
...
pg_upgrade ... -o 'sth' $PG_UPGRADE_OPT ...
...

I know that this problem is still script-able, but the fix should be
innocent and it would simplify things. Thanks for considering,

Pavel

Attachments:

0001-pg_upgrade-allow-passing-multiple-o-O-options.patchtext/x-patch; charset=utf-8; name=0001-pg_upgrade-allow-passing-multiple-o-O-options.patchDownload+19-5
#2Bruce Momjian
bruce@momjian.us
In reply to: Pavel Raiskup (#1)
Re: pg_upgrade: allow multiple -o/-O options

On Tue, Mar 4, 2014 at 04:52:56PM +0100, Pavel Raiskup wrote:

Hello,

RFE: Consider that you want to run pg_upgrade via some script with some
default '-o' option. But then you also want to give the script's user a
chance to specify the old-server's options according user's needs.
Then something like the following is not possible:

$ cat script
...
pg_upgrade ... -o 'sth' $PG_UPGRADE_OPT ...
...

I know that this problem is still script-able, but the fix should be
innocent and it would simplify things. Thanks for considering,

Attached is a patch that makes multiple -o options append their
arguments for pg_upgrade and pg_ctl, and documents this and the append
behavior of postmaster/postgres. This covers all the -o behaviors.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

Attachments:

dash-o.difftext/x-diff; charset=us-asciiDownload+47-47
#3Pavel Raiskup
praiskup@redhat.com
In reply to: Bruce Momjian (#2)
Re: pg_upgrade: allow multiple -o/-O options

On Thursday 21 of August 2014 18:26:37 Bruce Momjian wrote:

On Tue, Mar 4, 2014 at 04:52:56PM +0100, Pavel Raiskup wrote:

RFE: Consider that you want to run pg_upgrade via some script with some
default '-o' option. But then you also want to give the script's user a
chance to specify the old-server's options according user's needs.
Then something like the following is not possible:

$ cat script
...
pg_upgrade ... -o 'sth' $PG_UPGRADE_OPT ...
...

I know that this problem is still script-able, but the fix should be
innocent and it would simplify things. Thanks for considering,

Attached is a patch that makes multiple -o options append their
arguments for pg_upgrade and pg_ctl, and documents this and the append
behavior of postmaster/postgres. This covers all the -o behaviors.

Thanks! Seems to be OK to me, one nit - why you did not go the
append_optiton way (there could be probably better name like arg_cat)?
Because this is just about few lines, it is probably OK from PostgreSQL
policy POV, so "review? ~> review+", thanks again!

Pavel

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

#4Bruce Momjian
bruce@momjian.us
In reply to: Pavel Raiskup (#3)
Re: pg_upgrade: allow multiple -o/-O options

On Fri, Aug 22, 2014 at 10:52:12AM +0200, Pavel Raiskup wrote:

On Thursday 21 of August 2014 18:26:37 Bruce Momjian wrote:

On Tue, Mar 4, 2014 at 04:52:56PM +0100, Pavel Raiskup wrote:

RFE: Consider that you want to run pg_upgrade via some script with some
default '-o' option. But then you also want to give the script's user a
chance to specify the old-server's options according user's needs.
Then something like the following is not possible:

$ cat script
...
pg_upgrade ... -o 'sth' $PG_UPGRADE_OPT ...
...

I know that this problem is still script-able, but the fix should be
innocent and it would simplify things. Thanks for considering,

Attached is a patch that makes multiple -o options append their
arguments for pg_upgrade and pg_ctl, and documents this and the append
behavior of postmaster/postgres. This covers all the -o behaviors.

Thanks! Seems to be OK to me, one nit - why you did not go the
append_optiton way (there could be probably better name like arg_cat)?
Because this is just about few lines, it is probably OK from PostgreSQL
policy POV, so "review? ~> review+", thanks again!

Well, I found append_optiton() to be an extra function that wasn't
necessary --- the psprintf() use was short enough not to need a separate
function.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

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

#5Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#4)
Re: pg_upgrade: allow multiple -o/-O options

On Fri, Aug 22, 2014 at 10:02:11AM -0400, Bruce Momjian wrote:

On Fri, Aug 22, 2014 at 10:52:12AM +0200, Pavel Raiskup wrote:

On Thursday 21 of August 2014 18:26:37 Bruce Momjian wrote:

On Tue, Mar 4, 2014 at 04:52:56PM +0100, Pavel Raiskup wrote:

RFE: Consider that you want to run pg_upgrade via some script with some
default '-o' option. But then you also want to give the script's user a
chance to specify the old-server's options according user's needs.
Then something like the following is not possible:

$ cat script
...
pg_upgrade ... -o 'sth' $PG_UPGRADE_OPT ...
...

I know that this problem is still script-able, but the fix should be
innocent and it would simplify things. Thanks for considering,

Attached is a patch that makes multiple -o options append their
arguments for pg_upgrade and pg_ctl, and documents this and the append
behavior of postmaster/postgres. This covers all the -o behaviors.

Thanks! Seems to be OK to me, one nit - why you did not go the
append_optiton way (there could be probably better name like arg_cat)?
Because this is just about few lines, it is probably OK from PostgreSQL
policy POV, so "review? ~> review+", thanks again!

Well, I found append_optiton() to be an extra function that wasn't
necessary --- the psprintf() use was short enough not to need a separate
function.

Patch applied; this will appear in PG 9.5.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

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