* \unset -- unset variable */
| 2564 | * \unset -- unset variable |
| 2565 | */ |
| 2566 | static backslashResult |
| 2567 | exec_command_unset(PsqlScanState scan_state, bool active_branch, |
| 2568 | const char *cmd) |
| 2569 | { |
| 2570 | bool success = true; |
| 2571 | |
| 2572 | if (active_branch) |
| 2573 | { |
| 2574 | char *opt = psql_scan_slash_option(scan_state, |
| 2575 | OT_NORMAL, NULL, false); |
| 2576 | |
| 2577 | if (!opt) |
| 2578 | { |
| 2579 | pg_log_error("\\%s: missing required argument", cmd); |
| 2580 | success = false; |
| 2581 | } |
| 2582 | else if (!SetVariable(pset.vars, opt, NULL)) |
| 2583 | success = false; |
| 2584 | |
| 2585 | free(opt); |
| 2586 | } |
| 2587 | else |
| 2588 | ignore_slash_options(scan_state); |
| 2589 | |
| 2590 | return success ? PSQL_CMD_SKIP_LINE : PSQL_CMD_ERROR; |
| 2591 | } |
| 2592 | |
| 2593 | /* |
| 2594 | * \w -- write query buffer to file |
no test coverage detected