Re: [HACKERS] pgbench -f and vacuum

2015-05-12 Thread Stephen Frost
* Robert Haas (robertmh...@gmail.com) wrote: > On Tue, May 12, 2015 at 12:08 PM, Stephen Frost wrote: > > * Robert Haas (robertmh...@gmail.com) wrote: > >> It's says: > >> > >> starting vacuum ERROR: blah > >> ERROR: blah > >> ERROR: blah > >> done > >> > >> And then continues on. Sure, that'

Re: [HACKERS] pgbench -f and vacuum

2015-05-12 Thread Stephen Frost
* Robert Haas (robertmh...@gmail.com) wrote: > On Tue, May 12, 2015 at 12:08 PM, Stephen Frost wrote: > > * Robert Haas (robertmh...@gmail.com) wrote: > >> It's says: > >> > >> starting vacuum ERROR: blah > >> ERROR: blah > >> ERROR: blah > >> done > >> > >> And then continues on. Sure, that'

Re: [HACKERS] pgbench -f and vacuum

2015-05-12 Thread Robert Haas
On Tue, May 12, 2015 at 12:08 PM, Stephen Frost wrote: > * Robert Haas (robertmh...@gmail.com) wrote: >> It's says: >> >> starting vacuum ERROR: blah >> ERROR: blah >> ERROR: blah >> done >> >> And then continues on. Sure, that's not the greatest error reporting >> output ever, but what do yo

Re: [HACKERS] pgbench -f and vacuum

2015-05-12 Thread Stephen Frost
* Robert Haas (robertmh...@gmail.com) wrote: > It's says: > > starting vacuum ERROR: blah > ERROR: blah > ERROR: blah > done > > And then continues on. Sure, that's not the greatest error reporting > output ever, but what do you expect from pgbench? I think it's clear > enough what's going

Re: [HACKERS] pgbench -f and vacuum

2015-04-30 Thread Robert Haas
On Thu, Apr 30, 2015 at 4:17 PM, Tom Lane wrote: > Robert Haas writes: >> On Wed, Feb 11, 2015 at 2:00 PM, Jeff Janes wrote: >>> But as far as what has been discussed on the central topic of this thread, I >>> think that doing the vacuum and making the failure for non-existent tables >>> be non-

Re: [HACKERS] pgbench -f and vacuum

2015-04-30 Thread Tom Lane
Robert Haas writes: > On Wed, Feb 11, 2015 at 2:00 PM, Jeff Janes wrote: >> But as far as what has been discussed on the central topic of this thread, I >> think that doing the vacuum and making the failure for non-existent tables >> be non-fatal when -f is provided would be an improvement. Or m

Re: [HACKERS] pgbench -f and vacuum

2015-04-30 Thread Robert Haas
On Wed, Feb 11, 2015 at 2:00 PM, Jeff Janes wrote: > But as far as what has been discussed on the central topic of this thread, I > think that doing the vacuum and making the failure for non-existent tables > be non-fatal when -f is provided would be an improvement. Or maybe just > making it non-

Re: [HACKERS] pgbench -f and vacuum

2015-02-11 Thread Robert Haas
On Wed, Feb 11, 2015 at 2:00 PM, Jeff Janes wrote: > I would rather just learn to add the -n when I use -f > and don't have the default tables in place, than have to learn new methods > for saying "no really, I left -n off on purpose" when I have a custom file > which does use the default tables

Re: [HACKERS] pgbench -f and vacuum

2015-02-11 Thread Jeff Janes
On Tue, Dec 23, 2014 at 7:42 AM, Alvaro Herrera wrote: > Robert Haas wrote: > > On Mon, Dec 22, 2014 at 6:55 PM, Alvaro Herrera > > wrote: > > > Here's a completely different idea. How about we add an option that > > > means "vacuum this table before running the test" (can be given several > >

Re: [HACKERS] pgbench -f and vacuum

2015-02-10 Thread Peter Eisentraut
On 2/10/15 3:12 AM, Michael Paquier wrote: > On Tue, Feb 10, 2015 at 5:03 PM, Tatsuo Ishii wrote: >>> - The documentation misses some markups for pgbench and VACUUM and did >>> not respect the 80-character limit. >> >> I didn't realize that there's such a style guide. Although I think >> it's a goo

Re: [HACKERS] pgbench -f and vacuum

2015-02-10 Thread Tatsuo Ishii
> On Tue, Feb 10, 2015 at 5:03 PM, Tatsuo Ishii wrote: >>> - The documentation misses some markups for pgbench and VACUUM and did >>> not respect the 80-character limit. >> >> I didn't realize that there's such a style guide. Although I think >> it's a good thing, I just want to know where such a g

Re: [HACKERS] pgbench -f and vacuum

2015-02-10 Thread Michael Paquier
On Tue, Feb 10, 2015 at 5:03 PM, Tatsuo Ishii wrote: >> - The documentation misses some markups for pgbench and VACUUM and did >> not respect the 80-character limit. > > I didn't realize that there's such a style guide. Although I think > it's a good thing, I just want to know where such a guide is

Re: [HACKERS] pgbench -f and vacuum

2015-02-10 Thread Tatsuo Ishii
> On Mon, Feb 9, 2015 at 2:54 PM, Tatsuo Ishii wrote: >> Agreed. Here is the patch to implement the idea: -f just implies -n. > > Some small comments: > - is_no_vacuum, as well as is_init_mode, are defined as an integers > but their use imply that they are boolean switches. This patch sets > is_no

Re: [HACKERS] pgbench -f and vacuum

2015-02-09 Thread Michael Paquier
On Mon, Feb 9, 2015 at 2:54 PM, Tatsuo Ishii wrote: > Agreed. Here is the patch to implement the idea: -f just implies -n. Some small comments: - is_no_vacuum, as well as is_init_mode, are defined as an integers but their use imply that they are boolean switches. This patch sets is_no_vacuum to tr

Re: [HACKERS] pgbench -f and vacuum

2015-02-08 Thread Tatsuo Ishii
>>> Although that might be taking this thread rather far off-topic. >> Not really sure about that, because the only outstanding objection to >> this discussion is what happens in the startup stage if you specify -f. >> Right now vacuum is attempted on the standard tables, which is probably >> not t

Re: [HACKERS] pgbench -f and vacuum

2015-02-02 Thread Michael Paquier
On Wed, Dec 24, 2014 at 12:42 AM, Alvaro Herrera wrote: >> Although that might be taking this thread rather far off-topic. > Not really sure about that, because the only outstanding objection to > this discussion is what happens in the startup stage if you specify -f. > Right now vacuum is attempt

Re: [HACKERS] pgbench -f and vacuum

2014-12-23 Thread Alvaro Herrera
Robert Haas wrote: > On Mon, Dec 22, 2014 at 6:55 PM, Alvaro Herrera > wrote: > > Here's a completely different idea. How about we add an option that > > means "vacuum this table before running the test" (can be given several > > times); by default the set of vacuumed tables is the current pgbenc

Re: [HACKERS] pgbench -f and vacuum

2014-12-23 Thread Robert Haas
On Mon, Dec 22, 2014 at 6:55 PM, Alvaro Herrera wrote: > Here's a completely different idea. How about we add an option that > means "vacuum this table before running the test" (can be given several > times); by default the set of vacuumed tables is the current pgbench_* > list, but if -f is spec

Re: [HACKERS] pgbench -f and vacuum

2014-12-22 Thread Alvaro Herrera
Here's a completely different idea. How about we add an option that means "vacuum this table before running the test" (can be given several times); by default the set of vacuumed tables is the current pgbench_* list, but if -f is specified then the default set is cleared. So if you have a -f scri

Re: [HACKERS] pgbench -f and vacuum

2014-12-22 Thread Tatsuo Ishii
> First of all - I'm not entirely convinced the "IF EXISTS" approach is > somehow better than "-f implies -n" suggested before, but I don't have a > strong preference either. I revisited the "-f implies -n" approach again. The main reason why I wanted to avoid the approach was, it breaks the backw

Re: [HACKERS] pgbench -f and vacuum

2014-12-22 Thread Tomas Vondra
On 22.12.2014 18:41, Andres Freund wrote: > On 2014-12-22 18:17:56 +0100, Tomas Vondra wrote: >> On 22.12.2014 17:47, Alvaro Herrera wrote: >>> Tomas Vondra wrote: On 22.12.2014 07:36, Tatsuo Ishii wrote: > On 22.12.2014 00:28, Tomas Vondra wrote: >>> >> (8) Also, I think it's not nece

Re: [HACKERS] pgbench -f and vacuum

2014-12-22 Thread Andres Freund
On 2014-12-22 18:17:56 +0100, Tomas Vondra wrote: > On 22.12.2014 17:47, Alvaro Herrera wrote: > > Tomas Vondra wrote: > >> On 22.12.2014 07:36, Tatsuo Ishii wrote: > >>> On 22.12.2014 00:28, Tomas Vondra wrote: > > > (8) Also, I think it's not necessary to define function prototypes for > >>

Re: [HACKERS] pgbench -f and vacuum

2014-12-22 Thread Alvaro Herrera
Tomas Vondra wrote: > I'm not objecting to prototypes in general, but I believe the principle > is to respect how the existing code is written. There are almost no > other prototypes in pgbench.c - e.g. there are no prototypes for > executeStatement(), init() etc. so adding the prototypes in this

Re: [HACKERS] pgbench -f and vacuum

2014-12-22 Thread Tomas Vondra
On 22.12.2014 17:47, Alvaro Herrera wrote: > Tomas Vondra wrote: >> On 22.12.2014 07:36, Tatsuo Ishii wrote: >>> On 22.12.2014 00:28, Tomas Vondra wrote: > (8) Also, I think it's not necessary to define function prototypes for executeStatement2 and is_table_exists. It certainly is no

Re: [HACKERS] pgbench -f and vacuum

2014-12-22 Thread Alvaro Herrera
Tomas Vondra wrote: > On 22.12.2014 07:36, Tatsuo Ishii wrote: > > On 22.12.2014 00:28, Tomas Vondra wrote: > >> (8) Also, I think it's not necessary to define function prototypes for > >> executeStatement2 and is_table_exists. It certainly is not > >> consistent with the other functions d

Re: [HACKERS] pgbench -f and vacuum

2014-12-22 Thread Tomas Vondra
On 22.12.2014 07:36, Tatsuo Ishii wrote: > On 22.12.2014 00:28, Tomas Vondra wrote: >> >> (2) The 'executeStatement2' API is a bit awkward as the signarure >> >> executeStatement2(PGconn *con, const char *sql, const char *table); >> >> suggests that the 'sql' command is executed when 'table

Re: [HACKERS] pgbench -f and vacuum

2014-12-21 Thread Tatsuo Ishii
> Hi, > > On 21.12.2014 15:58, Tatsuo Ishii wrote: >>> On Sun, Dec 14, 2014 at 11:43 AM, Tatsuo Ishii wrote: > If we care enough about that case to attempt the vacuum anyway > then we need to do something about the error message; either > squelch it or check for the existence of the t

Re: [HACKERS] pgbench -f and vacuum

2014-12-21 Thread Tomas Vondra
Hi, On 21.12.2014 15:58, Tatsuo Ishii wrote: >> On Sun, Dec 14, 2014 at 11:43 AM, Tatsuo Ishii wrote: If we care enough about that case to attempt the vacuum anyway then we need to do something about the error message; either squelch it or check for the existence of the tables befo

Re: [HACKERS] pgbench -f and vacuum

2014-12-21 Thread Tatsuo Ishii
> - Error to apply to the current master: Works for me. $ git apply ~/pgbench-f-noexit-v2.patch $ Maybe git version difference or the patch file was malformed by mail client? > +static void executeStatement2(PGconn *con, const char *sql, const char > *table); > > I think we can use a better

Re: [HACKERS] pgbench -f and vacuum

2014-12-21 Thread Fabrízio de Royes Mello
On Sun, Dec 21, 2014 at 12:58 PM, Tatsuo Ishii wrote: > > > On Sun, Dec 14, 2014 at 11:43 AM, Tatsuo Ishii wrote: > >>> If we care enough about that case to attempt the vacuum anyway then we > >>> need to do something about the error message; either squelch it or > >>> check for the existence of

Re: [HACKERS] pgbench -f and vacuum

2014-12-21 Thread Tatsuo Ishii
> On Sun, Dec 14, 2014 at 11:43 AM, Tatsuo Ishii wrote: >>> If we care enough about that case to attempt the vacuum anyway then we >>> need to do something about the error message; either squelch it or >>> check for the existence of the tables before attempting to >>> vacuum. Since there's no way

Re: [HACKERS] pgbench -f and vacuum

2014-12-18 Thread Fujii Masao
On Sun, Dec 14, 2014 at 11:43 AM, Tatsuo Ishii wrote: >> If we care enough about that case to attempt the vacuum anyway then we >> need to do something about the error message; either squelch it or >> check for the existence of the tables before attempting to >> vacuum. Since there's no way to squ

Re: [HACKERS] pgbench -f and vacuum

2014-12-15 Thread Andres Freund
On 2014-12-15 10:55:30 -0800, Jeff Janes wrote: > On Sat, Dec 13, 2014 at 7:39 AM, Tom Lane wrote: > > > > Tatsuo Ishii writes: > > > Currently pgbench -f (run custom script) executes vacuum against > > > pgbench_* tables before stating bench marking if -n (or --no-vacuum) > > > is not specified.

Re: [HACKERS] pgbench -f and vacuum

2014-12-15 Thread Jeff Janes
On Sat, Dec 13, 2014 at 7:39 AM, Tom Lane wrote: > > Tatsuo Ishii writes: > > Currently pgbench -f (run custom script) executes vacuum against > > pgbench_* tables before stating bench marking if -n (or --no-vacuum) > > is not specified. If those tables do not exist, pgbench fails. To > > prevent

Re: [HACKERS] pgbench -f and vacuum

2014-12-15 Thread Robert Haas
On Sat, Dec 13, 2014 at 10:39 AM, Tom Lane wrote: > Tatsuo Ishii writes: >> Currently pgbench -f (run custom script) executes vacuum against >> pgbench_* tables before stating bench marking if -n (or --no-vacuum) >> is not specified. If those tables do not exist, pgbench fails. To >> prevent this

Re: [HACKERS] pgbench -f and vacuum

2014-12-13 Thread David Rowley
On 14 December 2014 at 13:50, Jim Nasby wrote: > > On 12/13/14, 6:17 PM, Tatsuo Ishii wrote: > >> Problem with "-f implies -n" approach is, it breaks backward >> compatibility. There are use cases using custom script*and* pgbench_* >> tables. For example the particular user wants to use the stand

Re: [HACKERS] pgbench -f and vacuum

2014-12-13 Thread Tatsuo Ishii
> If we care enough about that case to attempt the vacuum anyway then we > need to do something about the error message; either squelch it or > check for the existence of the tables before attempting to > vacuum. Since there's no way to squelch in the server logfile, I think > checking for the tabl

Re: [HACKERS] pgbench -f and vacuum

2014-12-13 Thread Jim Nasby
On 12/13/14, 6:17 PM, Tatsuo Ishii wrote: Problem with "-f implies -n" approach is, it breaks backward compatibility. There are use cases using custom script*and* pgbench_* tables. For example the particular user wants to use the standard pgbench tables and is not satisfied with the built in sce

Re: [HACKERS] pgbench -f and vacuum

2014-12-13 Thread Tatsuo Ishii
> On 14 December 2014 at 04:39, Tom Lane wrote: >> >> Tatsuo Ishii writes: >> > Currently pgbench -f (run custom script) executes vacuum against >> > pgbench_* tables before stating bench marking if -n (or --no-vacuum) >> > is not specified. If those tables do not exist, pgbench fails. To >> > pr

Re: [HACKERS] pgbench -f and vacuum

2014-12-13 Thread David Rowley
On 14 December 2014 at 04:39, Tom Lane wrote: > > Tatsuo Ishii writes: > > Currently pgbench -f (run custom script) executes vacuum against > > pgbench_* tables before stating bench marking if -n (or --no-vacuum) > > is not specified. If those tables do not exist, pgbench fails. To > > prevent th

Re: [HACKERS] pgbench -f and vacuum

2014-12-13 Thread Tom Lane
Tatsuo Ishii writes: > Currently pgbench -f (run custom script) executes vacuum against > pgbench_* tables before stating bench marking if -n (or --no-vacuum) > is not specified. If those tables do not exist, pgbench fails. To > prevent this, -n must be specified. For me this behavior seems insane

[HACKERS] pgbench -f and vacuum

2014-12-13 Thread Tatsuo Ishii
Currently pgbench -f (run custom script) executes vacuum against pgbench_* tables before stating bench marking if -n (or --no-vacuum) is not specified. If those tables do not exist, pgbench fails. To prevent this, -n must be specified. For me this behavior seems insane because "-f" does not necessa