Re: BUG #12379: pgbench should hint to pgbench -i

Поиск
Список
Период
Сортировка
От Oleksandr Shulgin
Тема Re: BUG #12379: pgbench should hint to pgbench -i
Дата
Msg-id 87oales6zm.fsf@ashulgin01.corp.ad.zalando.net
обсуждение исходный текст
Ответ на Re: BUG #12379: pgbench should hint to pgbench -i  (Fabien COELHO <coelho@cri.ensmp.fr>)
Ответы Re: BUG #12379: pgbench should hint to pgbench -i  (Fabien COELHO <coelho@cri.ensmp.fr>)
Re: BUG #12379: pgbench should hint to pgbench -i  (Fabien COELHO <coelho@cri.ensmp.fr>)
Список pgsql-bugs
Fabien COELHO <coelho@cri.ensmp.fr> writes:
>
>> sh> ./pgbench foo
>> ERROR:  relation "pgbench_branches" does not exist
>> LINE 1: select count(*) from pgbench_branches
>>                              ^
>> HINT: is "foo" the right database? did you initialize first (pgbench -i)?
>
> Here is a rebase, and it uses two spaces after the colon like it seems it
> is done elsewhere.
>
> HINT:  is "foo" the right database? did you initialize first (pgbench -i)?

I don't think there is precedent for spitting out "HINT:" in client code
(at least grep didn't find it).  So this message might look like it's
coming from the server, while it doesn't.

I think the following is closer to pre-existing experience, IMO:

diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
index 8b8b591..8d8c1fc 100644
--- a/src/bin/pgbench/pgbench.c
+++ b/src/bin/pgbench/pgbench.c
@@ -3250,6 +3250,7 @@ main(int argc, char **argv)
         if (PQresultStatus(res) != PGRES_TUPLES_OK)
         {
             fprintf(stderr, "%s", PQerrorMessage(con));
+            fprintf(stderr, "Is \"%s\" the right database? Did you initialize it first (pgbench -i)?\n", dbName);
             exit(1);
         }
         scale = atoi(PQgetvalue(res, 0, 0));

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Oleksandr Shulgin
Дата:
Сообщение: Re: PQexec() hangs on OOM
Следующее
От: Fabien COELHO
Дата:
Сообщение: Re: BUG #12379: pgbench should hint to pgbench -i