mirror of
https://github.com/postgres/postgres.git
synced 2026-03-03 13:51:00 -05:00
Throw nice error if server is too old to support psql's \ef or \sf command.
Previously, you'd get "function pg_catalog.pg_get_functiondef(integer) does not exist", which is at best rather unprofessional-looking. Back-patch to 8.4 where \ef was introduced. Josh Kupershmidt
This commit is contained in:
parent
019d45e139
commit
c49130ade4
1 changed files with 7 additions and 1 deletions
|
|
@ -508,7 +508,13 @@ exec_command(const char *cmd,
|
|||
*/
|
||||
else if (strcmp(cmd, "ef") == 0)
|
||||
{
|
||||
if (!query_buf)
|
||||
if (pset.sversion < 80400)
|
||||
{
|
||||
psql_error("The server (version %d.%d) does not support editing function source.\n",
|
||||
pset.sversion / 10000, (pset.sversion / 100) % 100);
|
||||
status = PSQL_CMD_ERROR;
|
||||
}
|
||||
else if (!query_buf)
|
||||
{
|
||||
psql_error("no query buffer\n");
|
||||
status = PSQL_CMD_ERROR;
|
||||
|
|
|
|||
Loading…
Reference in a new issue