* Transform format name for external table FORMAT option to format code and * validate that the requested format is supported. */
| 591 | * validate that the requested format is supported. |
| 592 | */ |
| 593 | static char |
| 594 | transformFormatType(char *formatname) |
| 595 | { |
| 596 | char result = '\0'; |
| 597 | |
| 598 | if (pg_strcasecmp(formatname, "text") == 0) |
| 599 | result = 't'; |
| 600 | else if (pg_strcasecmp(formatname, "csv") == 0) |
| 601 | result = 'c'; |
| 602 | else if (pg_strcasecmp(formatname, "custom") == 0) |
| 603 | result = 'b'; |
| 604 | else |
| 605 | ereport(ERROR, |
| 606 | (errcode(ERRCODE_SYNTAX_ERROR), |
| 607 | errmsg("unsupported format '%s'", formatname), |
| 608 | errhint("Available formats for external tables are \"text\", \"csv\" and \"custom\"."))); |
| 609 | |
| 610 | return result; |
| 611 | } |
| 612 | |
| 613 | /* |
| 614 | * Join the elements of the list separated by the specified delimiter and |
no test coverage detected