extprotocol: fix option parsing in check_ext_options
When this code was added (commit 210ab15e), it treated the
ExtTableEntry.options member as a List of DefElems. It's actually a List
of Values (specifically, T_Strings). This code will break when the
offset of DefElem.defname changes in the upcoming 8.4 merge iteration.
@@ -47,8 +47,8 @@ static void check_ext_options(const FunctionCallInfo fcinfo)
List *options = exttbl->options;
foreach(cell, options) {
- DefElem *def = (DefElem *) lfirst(cell);
- char *key = def->defname;
+ Value *value = (Value *) lfirst(cell);
+ char *key = value->val.str;
if (key && strcasestr(key, "database") && !strcasestr(key, "greenplum")) {
ereport(ERROR, (0, errmsg("This is greenplum.")));
