Re: pg_migrator issues - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: pg_migrator issues
Date
Msg-id 201001071240.o07Ce0V27340@momjian.us
Whole thread Raw
In response to Re: pg_migrator issues  (Bruce Momjian <bruce@momjian.us>)
Responses Re: pg_migrator issues
List pgsql-hackers
> Tom Lane wrote:
> > Peter Eisentraut <peter_e@gmx.net> writes:
> > > On m<C3><A5>n, 2010-01-04 at 13:07 -0500, Bruce Momjian wrote:
> > >> Yea, I am not excited about having vacuumdb do only analyze, but it
> > >> seems the most minimal solution.  I spelled it --only-analyze and just
> > >> posted the reason and patch.
> >
> > > I can't find the patch and the reason, but note that we already have
> > > other options like --data-only, --schema-only, --tuples-only.  I
> > > personally don't like the spelling of --only-analyze.
> >
> > In particular note that pg_dump has options --schema and --schema-only,
> > and nobody has complained about that.  I concur with Peter that this
> > spelling is gratuitously unlike everyplace else.
>
> Oh, interesting about pg_dump.  Let's just go with --analyze-only.
> --only-analyze is feeling odd to me too.

Done, attached and applied.

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

  + If your life is a hard drive, Christ can be your backup. +
Index: doc/src/sgml/ref/vacuumdb.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/ref/vacuumdb.sgml,v
retrieving revision 1.47
diff -c -c -r1.47 vacuumdb.sgml
*** doc/src/sgml/ref/vacuumdb.sgml    6 Jan 2010 05:31:13 -0000    1.47
--- doc/src/sgml/ref/vacuumdb.sgml    7 Jan 2010 12:37:08 -0000
***************
*** 28,34 ****
     <group><arg>--freeze</arg><arg>-F</arg></group>
     <group><arg>--verbose</arg><arg>-v</arg></group>
     <group><arg>--analyze</arg><arg>-z</arg></group>
!    <group><arg>--only-analyze</arg><arg>-o</arg></group>
     <arg>--table | -t <replaceable>table</replaceable>
      <arg>( <replaceable class="parameter">column</replaceable> [,...] )</arg>
     </arg>
--- 28,34 ----
     <group><arg>--freeze</arg><arg>-F</arg></group>
     <group><arg>--verbose</arg><arg>-v</arg></group>
     <group><arg>--analyze</arg><arg>-z</arg></group>
!    <group><arg>--analyze-only</arg><arg>-o</arg></group>
     <arg>--table | -t <replaceable>table</replaceable>
      <arg>( <replaceable class="parameter">column</replaceable> [,...] )</arg>
     </arg>
***************
*** 42,48 ****
     <group><arg>--freeze</arg><arg>-F</arg></group>
     <group><arg>--verbose</arg><arg>-v</arg></group>
     <group><arg>--analyze</arg><arg>-z</arg></group>
!    <group><arg>--only-analyze</arg><arg>-o</arg></group>
    </cmdsynopsis>
   </refsynopsisdiv>

--- 42,48 ----
     <group><arg>--freeze</arg><arg>-F</arg></group>
     <group><arg>--verbose</arg><arg>-v</arg></group>
     <group><arg>--analyze</arg><arg>-z</arg></group>
!    <group><arg>--analyze-only</arg><arg>-o</arg></group>
    </cmdsynopsis>
   </refsynopsisdiv>

***************
*** 143,149 ****

       <varlistentry>
        <term><option>-o</option></term>
!       <term><option>--only-analyze</option></term>
        <listitem>
         <para>
          Only calculate statistics for use by the optimizer (no vacuum).
--- 143,149 ----

       <varlistentry>
        <term><option>-o</option></term>
!       <term><option>--analyze-only</option></term>
        <listitem>
         <para>
          Only calculate statistics for use by the optimizer (no vacuum).
***************
*** 168,174 ****
         <para>
          Clean or analyze <replaceable class="parameter">table</replaceable> only.
          Column names can be specified only in conjunction with
!         the <option>--analyze</option> or <option>--only-analyze</option> options.
         </para>
         <tip>
          <para>
--- 168,174 ----
         <para>
          Clean or analyze <replaceable class="parameter">table</replaceable> only.
          Column names can be specified only in conjunction with
!         the <option>--analyze</option> or <option>--analyze-only</option> options.
         </para>
         <tip>
          <para>
Index: src/bin/scripts/vacuumdb.c
===================================================================
RCS file: /cvsroot/pgsql/src/bin/scripts/vacuumdb.c,v
retrieving revision 1.31
diff -c -c -r1.31 vacuumdb.c
*** src/bin/scripts/vacuumdb.c    6 Jan 2010 16:04:05 -0000    1.31
--- src/bin/scripts/vacuumdb.c    7 Jan 2010 12:37:08 -0000
***************
*** 15,26 ****


  static void vacuum_one_database(const char *dbname, bool full, bool inplace, bool verbose,
!                     bool and_analyze, bool only_analyze, bool freeze,
                      const char *table, const char *host, const char *port,
                      const char *username, enum trivalue prompt_password,
                      const char *progname, bool echo);
  static void vacuum_all_databases(bool full, bool inplace, bool verbose, bool and_analyze,
!                      bool only_analyze, bool freeze,
                       const char *host, const char *port,
                       const char *username, enum trivalue prompt_password,
                       const char *progname, bool echo, bool quiet);
--- 15,26 ----


  static void vacuum_one_database(const char *dbname, bool full, bool inplace, bool verbose,
!                     bool and_analyze, bool analyze_only, bool freeze,
                      const char *table, const char *host, const char *port,
                      const char *username, enum trivalue prompt_password,
                      const char *progname, bool echo);
  static void vacuum_all_databases(bool full, bool inplace, bool verbose, bool and_analyze,
!                      bool analyze_only, bool freeze,
                       const char *host, const char *port,
                       const char *username, enum trivalue prompt_password,
                       const char *progname, bool echo, bool quiet);
***************
*** 41,47 ****
          {"quiet", no_argument, NULL, 'q'},
          {"dbname", required_argument, NULL, 'd'},
          {"analyze", no_argument, NULL, 'z'},
!         {"only-analyze", no_argument, NULL, 'o'},
          {"freeze", no_argument, NULL, 'F'},
          {"all", no_argument, NULL, 'a'},
          {"table", required_argument, NULL, 't'},
--- 41,47 ----
          {"quiet", no_argument, NULL, 'q'},
          {"dbname", required_argument, NULL, 'd'},
          {"analyze", no_argument, NULL, 'z'},
!         {"analyze-only", no_argument, NULL, 'o'},
          {"freeze", no_argument, NULL, 'F'},
          {"all", no_argument, NULL, 'a'},
          {"table", required_argument, NULL, 't'},
***************
*** 63,69 ****
      bool        echo = false;
      bool        quiet = false;
      bool        and_analyze = false;
!     bool        only_analyze = false;
      bool        freeze = false;
      bool        alldb = false;
      char       *table = NULL;
--- 63,69 ----
      bool        echo = false;
      bool        quiet = false;
      bool        and_analyze = false;
!     bool        analyze_only = false;
      bool        freeze = false;
      bool        alldb = false;
      char       *table = NULL;
***************
*** 108,114 ****
                  and_analyze = true;
                  break;
              case 'o':
!                 only_analyze = true;
                  break;
              case 'F':
                  freeze = true;
--- 108,114 ----
                  and_analyze = true;
                  break;
              case 'o':
!                 analyze_only = true;
                  break;
              case 'F':
                  freeze = true;
***************
*** 155,161 ****
          exit(1);
      }

!     if (only_analyze)
      {
          if (full)
          {
--- 155,161 ----
          exit(1);
      }

!     if (analyze_only)
      {
          if (full)
          {
***************
*** 169,175 ****
                      progname);
              exit(1);
          }
!         /* allow 'and_analyze' with 'only_analyze' */
      }

      setup_cancel_handler();
--- 169,175 ----
                      progname);
              exit(1);
          }
!         /* allow 'and_analyze' with 'analyze_only' */
      }

      setup_cancel_handler();
***************
*** 189,195 ****
              exit(1);
          }

!         vacuum_all_databases(full, inplace, verbose, and_analyze, only_analyze, freeze,
                               host, port, username, prompt_password,
                               progname, echo, quiet);
      }
--- 189,195 ----
              exit(1);
          }

!         vacuum_all_databases(full, inplace, verbose, and_analyze, analyze_only, freeze,
                               host, port, username, prompt_password,
                               progname, echo, quiet);
      }
***************
*** 205,211 ****
                  dbname = get_user_name(progname);
          }

!         vacuum_one_database(dbname, full, inplace, verbose, and_analyze, only_analyze,
                              freeze, table,
                              host, port, username, prompt_password,
                              progname, echo);
--- 205,211 ----
                  dbname = get_user_name(progname);
          }

!         vacuum_one_database(dbname, full, inplace, verbose, and_analyze, analyze_only,
                              freeze, table,
                              host, port, username, prompt_password,
                              progname, echo);
***************
*** 217,223 ****

  static void
  vacuum_one_database(const char *dbname, bool full, bool inplace, bool verbose, bool and_analyze,
!                     bool only_analyze, bool freeze, const char *table,
                      const char *host, const char *port,
                      const char *username, enum trivalue prompt_password,
                      const char *progname, bool echo)
--- 217,223 ----

  static void
  vacuum_one_database(const char *dbname, bool full, bool inplace, bool verbose, bool and_analyze,
!                     bool analyze_only, bool freeze, const char *table,
                      const char *host, const char *port,
                      const char *username, enum trivalue prompt_password,
                      const char *progname, bool echo)
***************
*** 230,236 ****

      conn = connectDatabase(dbname, host, port, username, prompt_password, progname);

!     if (only_analyze)
      {
          appendPQExpBuffer(&sql, "ANALYZE");
          if (verbose)
--- 230,236 ----

      conn = connectDatabase(dbname, host, port, username, prompt_password, progname);

!     if (analyze_only)
      {
          appendPQExpBuffer(&sql, "ANALYZE");
          if (verbose)
***************
*** 306,312 ****


  static void
! vacuum_all_databases(bool full, bool inplace, bool verbose, bool and_analyze, bool only_analyze,
                       bool freeze, const char *host, const char *port,
                       const char *username, enum trivalue prompt_password,
                       const char *progname, bool echo, bool quiet)
--- 306,312 ----


  static void
! vacuum_all_databases(bool full, bool inplace, bool verbose, bool and_analyze, bool analyze_only,
                       bool freeze, const char *host, const char *port,
                       const char *username, enum trivalue prompt_password,
                       const char *progname, bool echo, bool quiet)
***************
*** 329,335 ****
              fflush(stdout);
          }

!         vacuum_one_database(dbname, full, inplace, verbose, and_analyze, only_analyze,
                              freeze, NULL, host, port, username, prompt_password,
                              progname, echo);
      }
--- 329,335 ----
              fflush(stdout);
          }

!         vacuum_one_database(dbname, full, inplace, verbose, and_analyze, analyze_only,
                              freeze, NULL, host, port, username, prompt_password,
                              progname, echo);
      }
***************
*** 351,357 ****
      printf(_("  -f, --full                      do full vacuuming\n"));
      printf(_("  -F, --freeze                    freeze row transaction information\n"));
      printf(_("  -i, --inplace                   do full inplace vacuuming\n"));
!     printf(_("  -o, --only-analyze              only update optimizer hints\n"));
      printf(_("  -q, --quiet                     don't write any messages\n"));
      printf(_("  -t, --table='TABLE[(COLUMNS)]'  vacuum specific table only\n"));
      printf(_("  -v, --verbose                   write a lot of output\n"));
--- 351,357 ----
      printf(_("  -f, --full                      do full vacuuming\n"));
      printf(_("  -F, --freeze                    freeze row transaction information\n"));
      printf(_("  -i, --inplace                   do full inplace vacuuming\n"));
!     printf(_("  -o, --analyze-only              only update optimizer hints\n"));
      printf(_("  -q, --quiet                     don't write any messages\n"));
      printf(_("  -t, --table='TABLE[(COLUMNS)]'  vacuum specific table only\n"));
      printf(_("  -v, --verbose                   write a lot of output\n"));

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: 'replication' keyword on .pgpass (Streaming Replication)
Next
From: Heikki Linnakangas
Date:
Subject: Re: 'replication' keyword on .pgpass (Streaming Replication)