From: Fabien COELHO <coelho@cri.ensmp.fr>
To: mail@bwe.im
Cc: PostgreSQL Bugs List <pgsql-bugs@postgresql.org>
Subject: Re: BUG #12379: pgbench should hint to pgbench -i
Date: Sun, 8 Mar 2015 08:55:25 +0100 (CET)
Message-ID: <alpine.DEB.2.10.1503080851220.4406@sto> (raw)
In-Reply-To: <20141231105955.8014.38426@wrigleys.postgresql.org>
References: <20141231105955.8014.38426@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
> $ pgbench bench -s 90000000 -j 1 -c 10
> ERROR: relation "pgbench_branches" does not exist
> LINE 1: select count(*) from pgbench_branches
>
> 11:51 MatheusOl$ bwe: You need to run `pgbench -i` first
>
> Why does the error message does not tell me this plainly? :)
Let us be nice to users. Attached is a very small patch which adds a
simple HINT on this initial failure, for submission to the next
commitfest.
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)?
--
Fabien.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugsAttachments:pgbench-hint-1.patch (text/x-diff, 490B) downloaddiff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.cindex 706fdf5..1c324ce 100644--- a/contrib/pgbench/pgbench.c+++ b/contrib/pgbench/pgbench.c@@ -3212,6 +3212,7 @@ main(int argc, char **argv)
if (PQresultStatus(res) != PGRES_TUPLES_OK)
{
fprintf(stderr, "%s", PQerrorMessage(con));
+ fprintf(stderr, "HINT: is \"%s\" the right database? did you initialize first (pgbench -i)?\n", dbName);
exit(1);
}
scale = atoi(PQgetvalue(res, 0, 0));
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: coelho@cri.ensmp.fr, mail@bwe.im
Subject: Re: BUG #12379: pgbench should hint to pgbench -i
In-Reply-To: <alpine.DEB.2.10.1503080851220.4406@sto>
References: <20141231105955.8014.38426@wrigleys.postgresql.org> <alpine.DEB.2.10.1503080851220.4406@sto>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox