static bool is_foreign_qual(Expr *expr);
static bool foreign_qual_walker(Node *node, void *context);
static char *deparseSql(ForeignScanState *scanstate);
-static int flatten_deflist(List *options,
- const char **keywords, const char **values);
static void check_conn_params(const char **keywords, const char **values);
/* tuple handling */
keywords = (const char **) palloc(sizeof(char *) * n);
values = (const char **) palloc(sizeof(char *) * n);
n = 0;
- n += flatten_deflist(server->options, all_keywords + n, all_values + n);
- n += flatten_deflist(user->options, all_keywords + n, all_values + n);
+ n += flatten_generic_options(server->options,
+ all_keywords + n, all_values + n);
+ n += flatten_generic_options(user->options,
+ all_keywords + n, all_values + n);
all_keywords[n] = all_values[n] = NULL;
for (i = 0, j = 0; all_keywords[i]; i++)
}
}
-/*
- * Flattern options into keywords and values buffers.
- */
-static int
-flatten_deflist(List *options, const char **keywords, const char **values)
-{
- ListCell *cell;
- int n = 0;
-
- foreach(cell, options)
- {
- DefElem *def = lfirst(cell);
-
- keywords[n] = def->defname;
- values[n] = strVal(def->arg);
- n++;
- }
- return n;
-}
-
/*
* For non-superusers, insist that the connstr specify a password. This
* prevents a password from being picked up from .pgpass, a service file,
keywords = (const char **) palloc(sizeof(char *) * n);
values = (const char **) palloc(sizeof(char *) * n);
n = 0;
- n += flatten_deflist(server->options, keywords + n, values + n);
- n += flatten_deflist(table->options, keywords + n, values + n);
+ n += flatten_generic_options(server->options, keywords + n, values + n);
+ n += flatten_generic_options(table->options, keywords + n, values + n);
keywords[n] = values[n] = NULL;
/*
extern ForeignTable *GetForeignTable(Oid relid);
extern FdwRoutine *GetFdwRoutine(Oid fdwhandler);
extern bool IsForeignTable(Oid relid);
+extern int flatten_generic_options(List *options,
+ const char **keywords, const char **values);
/* ALTER FOREIGN TABLE ... OPTIONS (...) handlers */
extern void ATExecGenericOptions(Relation rel, List *options);