Re: psql possible TODO - Mailing list pgsql-hackers

From Joshua D. Drake
Subject Re: psql possible TODO
Date
Msg-id 1165358814.31648.89.camel@localhost.localdomain
Whole thread Raw
In response to Re: psql possible TODO  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: psql possible TODO
Re: psql possible TODO
List pgsql-hackers
On Tue, 2006-12-05 at 17:34 -0500, Tom Lane wrote:
> Stephen Harris <lists@spuddy.org> writes:
> > Silly: You could even do \r xyz and load the buffer with the last line
> > beginning xyz
> 
> We've got that: control-R xyz.
> 
> The thing I'm having a hard time with here is the notion that command
> number is a convenient way of identifying prior commands.  It seems like
> an idea that should have gone out with punched cards.

Imagine that you are profiling 50 queries, the queries are all the same
except for varying where clauses or joins.

Perhaps you are building out a query that contains 50 joins, and you are
building one step at a time (which I do ALL the time). You get to join
47 and realize that your data set isn't right.

Now, there is a chance that query 46 is the query that I want, but
ooops, I have 3 syntax errors so now it is actually query 43. How do I
get back to 43?

I ctrl-r... which really doesn't seem useful in this sense.
I \s and copy and paste? Even worse and what I do now.

Or... I \s and hit !46 (or whatever the ! becomes).

!46 seems awful easy to me.

Worse yet... what if it is actually query 27 because I got distracted by
a support question over jabber from the customer I am actually working
on and I need to help him profile a query for a couple of minutes?

Sincerely,

Joshua D. Drake

> 
>             regards, tom lane
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
> 
-- 
     === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997            http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate





pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: psql possible TODO
Next
From: Dave Page
Date:
Subject: Re: Source directory