Re: Inconsistent style in pgbench's error messages - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: Inconsistent style in pgbench's error messages
Date
Msg-id alpine.DEB.2.10.1507060624230.7427@sto
Whole thread Raw
In response to Inconsistent style in pgbench's error messages  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Inconsistent style in pgbench's error messages  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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.



pgsql-hackers by date:

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