Allow multiple --table options to be specified on the command-line.

Per Issue #18. SimpleStringList code borrowed from pg_dump and a
pending patch to add similar functionality to pg_restore,
clusterdb, vacuumdb, and reindexdb.

The error handling in reorg_one_table() could still be much improved,
so that an error processing a single table doesn't cause pg_reorg to
necessarily bail out and skip further tables, but I'll leave that for
another day.
This commit is contained in:
Josh Kupershmidt
2012-11-06 22:07:46 -07:00
committed by Daniele Varrazzo
parent ad00eb181d
commit ad75dcfbb1
5 changed files with 83 additions and 16 deletions

View File

@ -171,6 +171,23 @@ extern bool parse_time(const char *value, time_t *time);
#define ToLower(c) (tolower((unsigned char)(c)))
#define ToUpper(c) (toupper((unsigned char)(c)))
/* linked list of string values and helper functions, stolen from pg_dump. */
typedef struct SimpleStringListCell
{
struct SimpleStringListCell *next;
char val[1]; /* VARIABLE LENGTH FIELD */
} SimpleStringListCell;
typedef struct SimpleStringList
{
SimpleStringListCell *head;
SimpleStringListCell *tail;
} SimpleStringList;
extern void simple_string_list_append(SimpleStringList *list, const char *val);
extern bool simple_string_list_member(SimpleStringList *list, const char *val);
/*
* socket operations
*/