Re: Patch to fix search_path defencies with pg_bench - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Patch to fix search_path defencies with pg_bench
Date
Msg-id 1241705527.6109.188.camel@ebony.2ndQuadrant
Whole thread Raw
In response to Re: Patch to fix search_path defencies with pg_bench  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Patch to fix search_path defencies with pg_bench
List pgsql-hackers
On Wed, 2009-05-06 at 15:18 -0400, Tom Lane wrote:
> "Dickson S. Guedes" <listas@guedesoft.net> writes:
> > Em Qua, 2009-05-06 s 09:37 -0400, Tom Lane escreveu:
> >> Seems like the right policy for that is "run pgbench in its own
> >> database". 
> 
> > A text warning about this could be shown at start of pgbench if the
> > target database isn't named "pgbench", for examplo, or just some text
> > could be added to the docs.
> 
> There already is a prominent warning in the pgbench docs:
> 
>         Caution
> 
>     pgbench -i creates four tables accounts, branches, history, and
>     tellers, destroying any existing tables of these names. Be very
>     careful to use another database if you have tables having these
>     names!

Holy Handgrenade, what a huge footgun! It doesn't even have a
conceivable upside.

The table names "accounts" and "history" are fairly common and a caution
isn't a sufficient safeguard on production data. We know the manual
rarely gets read *after* a problem, let alone beforehand.

We should check they are the correct tables before we just drop them.
Perhaps check for the comment "Tables for pgbench application. Not
production data" on the tables, which would be nice to add anyway.

-- Simon Riggs           www.2ndQuadrant.comPostgreSQL Training, Services and Support



pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Serializable Isolation without blocking
Next
From: "Albe Laurenz"
Date:
Subject: Re: Serializable Isolation without blocking