Re: [HACKERS] Verifying variable names in pgbench

2010-01-04 Thread Robert Haas
On Mon, Jan 4, 2010 at 10:44 PM, Takahiro Itagaki wrote: > Robert Haas wrote: > >> What is currently done for other, similar error messages? > > Current error messages are: >  for commands: ": out of memory" >  for others  : "Couldn't allocate memory for variable" > > The new message is: ": out o

Re: [HACKERS] Verifying variable names in pgbench

2010-01-04 Thread Takahiro Itagaki
Robert Haas wrote: > What is currently done for other, similar error messages? Current error messages are: for commands: ": out of memory" for others : "Couldn't allocate memory for variable" The new message is: ": out of memory for variable ''" Regards, --- Takahiro Itagaki NTT Open Sou

Re: [HACKERS] Verifying variable names in pgbench

2010-01-04 Thread Robert Haas
On Mon, Jan 4, 2010 at 10:00 PM, Takahiro Itagaki wrote: > > Takahiro Itagaki wrote: > >> We can remove the complexity if we give up showing the command (arg0) >> in error messages. Shall we remove it? Simplified patch attached. > > Here is the proposal for the arg0 issue. > I added "context" arg

Re: [HACKERS] Verifying variable names in pgbench

2010-01-04 Thread Takahiro Itagaki
Takahiro Itagaki wrote: > We can remove the complexity if we give up showing the command (arg0) > in error messages. Shall we remove it? Simplified patch attached. Here is the proposal for the arg0 issue. I added "context" argument to putVariable(). The context is a command name for \setXXX com

Re: [HACKERS] Verifying variable names in pgbench

2010-01-03 Thread Takahiro Itagaki
Robert Haas wrote: > > The attached patch verifies variable names at definition. > > $ pgbench -D var:name=value > > (global): invalid variable name 'var:name' > > I have reviewed this patch. I think that the basic idea of rejecting > invalid variable names is probably a good one, but

[HACKERS] Verifying variable names in pgbench

2009-12-27 Thread Takahiro Itagaki
We can define variables with any names in pgbench, but only can refer them with names that consist of [A-Za-z0-9_]+ . It could cause confusion discussed here: http://archives.postgresql.org/message-id/4b272833.8080...@2ndquadrant.com The attached patch verifies variable names at definition. $