Index: src/bin/psql/command.c =================================================================== --- src/bin/psql/command.c (8.4dev 2008-08-28) +++ src/bin/psql/command.c (working copy) @@ -333,6 +333,7 @@ show_verbose = strchr(cmd, '+') ? true : false; + ignore_notices = true; switch (cmd[1]) { case '\0': @@ -418,6 +419,7 @@ default: status = PSQL_CMD_UNKNOWN; } + ignore_notices = false; if (pattern) free(pattern); Index: src/bin/psql/common.c =================================================================== --- src/bin/psql/common.c (8.4dev 2008-08-28) +++ src/bin/psql/common.c (working copy) @@ -26,8 +26,9 @@ #include "copy.h" #include "mbprint.h" +/* Flag to ignore backend notices (used during tab-completion) */ +bool ignore_notices = false; - static bool ExecQueryUsingCursor(const char *query, double *elapsed_msec); static bool command_no_begin(const char *query); static bool is_select_command(const char *query); @@ -180,7 +181,9 @@ NoticeProcessor(void *arg, const char *message) { (void) arg; /* not used */ - psql_error("%s", message); + + if (!ignore_notices) + psql_error("%s", message); } Index: src/bin/psql/common.h =================================================================== --- src/bin/psql/common.h (8.4dev 2008-08-28) +++ src/bin/psql/common.h (working copy) @@ -63,4 +63,7 @@ extern char *expand_tilde(char **filename); +/* Flag to ignore backend notices (used during tab-completion) */ +extern bool ignore_notices; + #endif /* COMMON_H */ Index: src/bin/psql/tab-complete.c =================================================================== --- src/bin/psql/tab-complete.c (8.4dev 2008-08-28) +++ src/bin/psql/tab-complete.c (working copy) @@ -2575,7 +2575,9 @@ if (query == NULL || !pset.db || PQstatus(pset.db) != CONNECTION_OK) return NULL; + ignore_notices = true; result = PQexec(pset.db, query); + ignore_notices = false; if (PQresultStatus(result) != PGRES_TUPLES_OK) {