Lists: | pgsql-hackers |
---|
From: | Pavel Raiskup <praiskup(at)redhat(dot)com> |
---|---|
To: | pgsql-hackers(at)postgresql(dot)org |
Cc: | hhorak(at)redhat(dot)com |
Subject: | pg_upgrade: allow multiple -o/-O options |
Date: | 2014-03-04 15:52:56 |
Message-ID: | 2388764.h55D4LNXF4@nb.usersys.redhat.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
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
Attachment | Content-Type | Size |
---|---|---|
0001-pg_upgrade-allow-passing-multiple-o-O-options.patch | text/x-patch | 1.8 KB |
From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | Pavel Raiskup <praiskup(at)redhat(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org, hhorak(at)redhat(dot)com |
Subject: | Re: pg_upgrade: allow multiple -o/-O options |
Date: | 2014-08-21 22:26:37 |
Message-ID: | 20140821222637.GC17771@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ Everyone has their own god. +
Attachment | Content-Type | Size |
---|---|---|
dash-o.diff | text/x-diff | 5.9 KB |
From: | Pavel Raiskup <praiskup(at)redhat(dot)com> |
---|---|
To: | Bruce Momjian <bruce(at)momjian(dot)us> |
Cc: | pgsql-hackers(at)postgresql(dot)org, hhorak(at)redhat(dot)com |
Subject: | Re: pg_upgrade: allow multiple -o/-O options |
Date: | 2014-08-22 08:52:12 |
Message-ID: | 2837578.WU4QXfJeMN@nb.usersys.redhat.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
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
From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | Pavel Raiskup <praiskup(at)redhat(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org, hhorak(at)redhat(dot)com |
Subject: | Re: pg_upgrade: allow multiple -o/-O options |
Date: | 2014-08-22 14:02:11 |
Message-ID: | 20140822140211.GA21456@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ Everyone has their own god. +
From: | Bruce Momjian <bruce(at)momjian(dot)us> |
---|---|
To: | Pavel Raiskup <praiskup(at)redhat(dot)com> |
Cc: | pgsql-hackers(at)postgresql(dot)org, hhorak(at)redhat(dot)com |
Subject: | Re: pg_upgrade: allow multiple -o/-O options |
Date: | 2014-08-25 20:30:41 |
Message-ID: | 20140825203041.GA14956@momjian.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ Everyone has their own god. +