Re: pg_dump -X

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: pg_dump -X
Дата
Msg-id 201103110336.p2B3atU16338@momjian.us
обсуждение исходный текст
Ответ на pg_dump -X  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas wrote:
> Back in 2006, we have this commit:
>
> commit 2b25e1169f44368c120931787628d51731b5cc8c
> Author: Peter Eisentraut <peter_e@gmx.net>
> Date:   Sat Oct 7 20:59:05 2006 +0000
>
>     The -X option in pg_dump was supposed to be a workaround for the lack of
>     portable long options.  But we have had portable long options for a long
>     time now, so this is obsolete.  Now people have added options which *only*
>     work with -X but not as regular long option, so I'm putting a stop to this:
>     -X is deprecated; it still works, but it has been removed from the
>     documentation, and please don't add more of them.
>
> Since then, two additional -X options have crept in, doubtless due to
> mimicry of the existing options without examination of the commit
> logs.  I think we should either (a) remove the -X option altogether or
> (b) change the comment so that it clearly states the same message that
> appears here in the commit log, namely, that no new -X options are to
> be created.  The existing comment says that -X is deprecated, but that
> doesn't make it entirely 100% clear that the code isn't intended to be
> further updated, at least judging by the results.

Code comment added with attached, applied patch.

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

  + It's impossible for everything to be true. +
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
new file mode 100644
index 0884517..feeeae8
*** a/src/bin/pg_dump/pg_dump.c
--- b/src/bin/pg_dump/pg_dump.c
*************** main(int argc, char **argv)
*** 469,475 ****
                  break;

              case 'X':
!                 /* -X is a deprecated alternative to long options */
                  if (strcmp(optarg, "disable-dollar-quoting") == 0)
                      disable_dollar_quoting = 1;
                  else if (strcmp(optarg, "disable-triggers") == 0)
--- 469,478 ----
                  break;

              case 'X':
!                 /*
!                  *    -X is a deprecated alternative to long options;
!                  *    no new -X options are to be added.
!                  */
                  if (strcmp(optarg, "disable-dollar-quoting") == 0)
                      disable_dollar_quoting = 1;
                  else if (strcmp(optarg, "disable-triggers") == 0)

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Default mode for shutdown
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: pg_dump -X