Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data

Поиск
Список
Период
Сортировка
Искать
От
Thomas Munro
Тема
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data
Дата
в 12:07:49
Msg-id
CAEepm=1ycd4+4370XAdYB6qK=B-Xy6SqAHhcJs+5Fpbx3J0q5g@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Add --include-table-data-where option to pg_dump, to export only asubset of table data Carter Thaxton <carter.thaxton@gmail.com>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Stephen Frost <sfrost@snowman.net>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Thomas Munro <thomas.munro@enterprisedb.com>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Carter Thaxton <carter.thaxton@gmail.com>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Thomas Munro <thomas.munro@enterprisedb.com>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Carter Thaxton <carter.thaxton@gmail.com>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Carter Thaxton <carter.thaxton@gmail.com>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Surafel Temesgen <surafel3000@gmail.com>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Robert Haas <robertmhaas@gmail.com>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Carter Thaxton <carter.thaxton@gmail.com>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Michael Paquier <michael@paquier.xyz>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Carter Thaxton <carter.thaxton@gmail.com>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Surafel Temesgen <surafel3000@gmail.com>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Surafel Temesgen <surafel3000@gmail.com>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Robert Haas <robertmhaas@gmail.com>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Euler Taveira <euler@timbira.com.br>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Carter Thaxton <carter.thaxton@gmail.com>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Jeremy Finzel <finzelj@gmail.com>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data "David G. Johnston" <david.g.johnston@gmail.com>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Jeremy Finzel <finzelj@gmail.com>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Dmitry Dolgov <9erthalion6@gmail.com>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Andres Freund <andres@anarazel.de>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Carter Thaxton <carter.thaxton@gmail.com>
Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data Surafel Temesgen <surafel3000@gmail.com>
On Wed, May 23, 2018 at 5:18 PM, Carter Thaxton
 wrote:
> Ah yes, thanks.  I did in fact have colors enabled.
> I've attached a new patch generated by `git format-patch`.  Hopefully that's
> correct.

pg_dump.c:2323:2: warning: ISO C90 forbids mixed declarations and code
[-Wdeclaration-after-statement]
  char *filter_clause = NULL;
  ^

You need to declare this variable at the top of its scope.  If you're
using GCC or Clang you might consider building with COPT=-Werror so
that any compiler warnings will stop the build from succeeding.

This doesn't build on Windows[1], probably for the same reason.

 /*
  * Is OID present in the list?
+ * Also return extra pointer-sized data by setting extra_data paramter
  */
 bool
-simple_oid_list_member(SimpleOidList *list, Oid val)
+simple_oid_list_member2(SimpleOidList *list, Oid val, void **extra_data)

I feel like that isn't in the spirit of Lisp "member".  It's now a
kind of association list.  I wonder if we are really constrained to
use the cave-man facilities in fe_utils anyway.  Though I suppose this
list is never going to be super large so maybe the data structure
doesn't matter too much (famous last words).

+ char *where_clause = pg_malloc(strlen(filter_clause) + 8 + 1);
+ strcpy(where_clause, "WHERE (");
+ strcat(where_clause, filter_clause);
+ strcat(where_clause, ")");

pg_dump.c seems to be allowed to use psprintf() which'd be less
fragile than the above code.

+ /* When match_data is set, split the pattern on the ':' chararcter,

typo

+ * Also return extra pointer-sized data by setting extra_data paramter

typo

[1] https://ci.appveyor.com/project/postgresql-cfbot/postgresql/build/1.0.311

-- 
Thomas Munro
http://www.enterprisedb.com

В списке pgsql-hackers по дате отправления
От: Magnus Hagander
Дата:
От: Heikki Linnakangas
Дата:
FAQ