Re: Inconsistent style in pgbench's error messages

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Developers <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Inconsistent style in pgbench's error messages
Date: 2015-07-06 05:03:13
Message-ID: alpine.DEB.2.10.1507060624230.7427@sto
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Hello Tom,

> Personally I think "pgbench: " adds very little and so I'd rather get
> rid of it, but I'm sure others feel differently.

I think that one of the reason for this is that once pgbench started to
run it is desirable to differentiate error messages that come from libpq
and those that come from pgbench itsef.

Although for some messages this may be obvious, this may not always be the
case.

For instance "invalid variable name", such a message may come from a
plpgsql function invoked.

Example from psql with a prefix:

sh> psql -p 12345678
psql: invalid port number: "12345678"

> Another issue here is that when dealing with custom scripts, IMO it
> would be really helpful to provide the file name, line number, and
> perhaps line text whenever a message is about an identifiable command.
> That's mostly not happening at present, except for the aforesaid
> inconsistent mentions of metacommand names. To make that happen, we'd
> need to agree on a formatting convention for attaching the info. I'd be
> inclined to put it on a separate line, but beyond that have no specific
> thoughts.

Just to bootstap something, say:

pgbench "test.sql": error message...

Then maybe:

LINE 3: content of the line if available...

I'm not sure that the line contents would necessarily be available, it may
have been tokenized in some cases, if so it may have to be kept around.

I'm not sure how to deal with "internal" scripts. Maybe:

pgbench "TPC-B (sort-of)": ...

--
Fabien.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2015-07-06 05:06:07 Re: pg_archivecleanup, and backup filename to specify as an argument
Previous Message Amit Kapila 2015-07-06 03:30:50 Re: Let PostgreSQL's On Schedule checkpoint write buffer smooth spread cycle by tuning IsCheckpointOnSchedule?