| 201 | } |
| 202 | |
| 203 | ExtTableEntry * |
| 204 | GetExtFromForeignTableOptions(List *ftoptons, Oid relid) |
| 205 | { |
| 206 | ExtTableEntry *extentry; |
| 207 | ListCell *lc; |
| 208 | List *entryOptions = NIL; |
| 209 | char *arg; |
| 210 | bool rejectlimit_found = false; |
| 211 | bool rejectlimittype_found = false; |
| 212 | bool logerrors_found = false; |
| 213 | bool encoding_found = false; |
| 214 | bool iswritable_found = false; |
| 215 | bool executeon_found = false; |
| 216 | |
| 217 | extentry = (ExtTableEntry *) palloc0(sizeof(ExtTableEntry)); |
| 218 | |
| 219 | foreach(lc, ftoptons) |
| 220 | { |
| 221 | DefElem *def = (DefElem *) lfirst(lc); |
| 222 | |
| 223 | if (pg_strcasecmp(def->defname, "location_uris") == 0) |
| 224 | { |
| 225 | extentry->urilocations = TokenizeLocationUris(defGetString(def)); |
| 226 | continue; |
| 227 | } |
| 228 | |
| 229 | if (pg_strcasecmp(def->defname, "execute_on") == 0) |
| 230 | { |
| 231 | extentry->execlocations = list_make1(makeString(defGetString(def))); |
| 232 | executeon_found = true; |
| 233 | continue; |
| 234 | } |
| 235 | |
| 236 | if (pg_strcasecmp(def->defname, "command") == 0) |
| 237 | { |
| 238 | extentry->command = defGetString(def); |
| 239 | continue; |
| 240 | } |
| 241 | |
| 242 | if (pg_strcasecmp(def->defname, "format_type") == 0) |
| 243 | { |
| 244 | arg = defGetString(def); |
| 245 | extentry->fmtcode = arg[0]; |
| 246 | continue; |
| 247 | } |
| 248 | |
| 249 | /* only CSV format needs this for ProcessCopyOptions(), will do it later */ |
| 250 | if (pg_strcasecmp(def->defname, "format") == 0) |
| 251 | { |
| 252 | continue; |
| 253 | } |
| 254 | |
| 255 | if (pg_strcasecmp(def->defname, "reject_limit") == 0) |
| 256 | { |
| 257 | extentry->rejectlimit = atoi(defGetString(def)); |
| 258 | rejectlimit_found = true; |
| 259 | continue; |
| 260 | } |
no test coverage detected