Re: [HACKERS] Inconsistent style in pgbench's error messages

2015-07-06 Thread Tom Lane
Fabien COELHO coe...@cri.ensmp.fr writes:
 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.

Don't really see the issue.  Errors reported by the server are easy to
distinguish by formatting (as long as we don't go out of our way to make
pgbench's errors look like them, which is one reason I do not like the
HINT proposal in the bug #12379 thread).  Errors reported by libpq
itself might look like they came from pgbench, but I don't exactly see
what's wrong with that.  I don't think users much care about the
difference, as long as they can tell server-side errors apart from
client-side errors.

regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[HACKERS] Inconsistent style in pgbench's error messages

2015-07-05 Thread Tom Lane
I made a pass over pgbench's error messages to try to make them meet
project style guidelines.  There was one rather large bit of inconsistency
that I didn't try to fix, though: something like half of the messages
prepend pgbench:  to the front, but the other half don't.  Worse yet,
some of the other half prepend other things like metacommand names, which
seems quite confusing if you're expecting the former convention.

I'd like to see that become consistent, but I am not sure which way we
want to jump.  Personally I think pgbench:  adds very little and so
I'd rather get rid of it, but I'm sure others feel differently.

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.

Comments?

regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Inconsistent style in pgbench's error messages

2015-07-05 Thread Joshua D. Drake


On 07/05/2015 04:46 PM, Tom Lane wrote:

I made a pass over pgbench's error messages to try to make them meet
project style guidelines.  There was one rather large bit of inconsistency
that I didn't try to fix, though: something like half of the messages
prepend pgbench:  to the front, but the other half don't.  Worse yet,
some of the other half prepend other things like metacommand names, which
seems quite confusing if you're expecting the former convention.

I'd like to see that become consistent, but I am not sure which way we
want to jump.  Personally I think pgbench:  adds very little and so
I'd rather get rid of it, but I'm sure others feel differently.


I would agree that adding pgbench is useless. You know if you ware 
running pgbench. Heck if you don't know, the logs become rather obvious 
regardless.


JD





--
Command Prompt, Inc. - http://www.commandprompt.com/  503-667-4564
PostgreSQL Centered full stack support, consulting and development.
Announcing I'm offended is basically telling the world you can't
control your own emotions, so everyone else should do it for you.


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


Re: [HACKERS] Inconsistent style in pgbench's error messages

2015-07-05 Thread Fabien COELHO


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.


--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers