Re: [HACKERS] psql and readline

2003-02-19 Thread Ross J. Reedstrom
On Wed, Feb 19, 2003 at 12:03:44AM +0100, Peter Eisentraut wrote: > Ross J. Reedstrom writes: > > > Yes, BSD systems that install libedit directly in /usr/include (or into > > readline), like Patrick's, don't need it, but mine do. Is there some > > reason we _shouldn't_ support this configuration

Re: [HACKERS] psql and readline

2003-02-19 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Ross J. Reedstrom wrote: >> On Wed, Feb 19, 2003 at 12:03:44AM +0100, Peter Eisentraut wrote: >>> I don't like adding code to support every configuration that someone >>> dreamed up but no one actually needs. >> >> Hmm, isn't this exactly what configure i

Re: [HACKERS] psql and readline

2003-02-18 Thread Bruce Momjian
Ross J. Reedstrom wrote: > On Wed, Feb 19, 2003 at 12:03:44AM +0100, Peter Eisentraut wrote: > > Ross J. Reedstrom writes: > > > > > Yes, BSD systems that install libedit directly in /usr/include (or into > > > readline), like Patrick's, don't need it, but mine do. Is there some > > > reason we _

Re: [HACKERS] psql and readline

2003-02-18 Thread Peter Eisentraut
Ross J. Reedstrom writes: > Yes, BSD systems that install libedit directly in /usr/include (or into > readline), like Patrick's, don't need it, but mine do. Is there some > reason we _shouldn't_ support this configuration? I don't like adding code to support every configuration that someone drea

Re: [HACKERS] psql and readline

2003-02-18 Thread Ross J. Reedstrom
On Mon, Feb 17, 2003 at 12:05:20AM +0100, Peter Eisentraut wrote: > Ross J. Reedstrom writes: > > I don't think this is what we were out for. We've certainly been running > with libedit for a long time without anyone ever mentioning > /usr/include/editline. I suggest this part is taken out. Wel

Re: [HACKERS] psql and readline

2003-02-18 Thread Ross J. Reedstrom
On Sat, Feb 15, 2003 at 03:10:19PM -0600, Ross J. Reedstrom wrote: > On Fri, Feb 14, 2003 at 11:32:02AM -0500, Tom Lane wrote: > > Patrick Welche <[EMAIL PROTECTED]> writes: > > > On Thu, Feb 13, 2003 at 10:25:52AM -0500, Tom Lane wrote: > > >> Well, is that a bug in your wrapper? Or must we add a

Re: [HACKERS] psql and readline

2003-02-16 Thread Peter Eisentraut
Ross J. Reedstrom writes: > O.K., I found the 'editline' wrapper around 'libedit' that provides > a subset of readline functionality, and used that for testing. On my > Debian Linux systems, editline installs readline compatability headers > (readline.h, history.h) into /usr/include/editline/, so

Re: [HACKERS] psql and readline

2003-02-16 Thread Patrick Welche
On Sat, Feb 15, 2003 at 03:10:19PM -0600, Ross J. Reedstrom wrote: > On Fri, Feb 14, 2003 at 11:32:02AM -0500, Tom Lane wrote: > > Patrick Welche <[EMAIL PROTECTED]> writes: > > > On Thu, Feb 13, 2003 at 10:25:52AM -0500, Tom Lane wrote: > > >> Well, is that a bug in your wrapper? Or must we add a

Re: [HACKERS] psql and readline

2003-02-14 Thread Tom Lane
Patrick Welche <[EMAIL PROTECTED]> writes: > On Thu, Feb 13, 2003 at 10:25:52AM -0500, Tom Lane wrote: >> Well, is that a bug in your wrapper? Or must we add a configure test >> for the presence of replace_history_entry()? > Good question. Easiest for now for me would be add a configure test. Ok

Re: [HACKERS] psql and readline

2003-02-14 Thread Patrick Welche
On Thu, Feb 13, 2003 at 10:25:52AM -0500, Tom Lane wrote: > Patrick Welche <[EMAIL PROTECTED]> writes: > > The sad thing is that my readline wrapper for libedit doesn't wrap > > replace_history_entry, > > Well, is that a bug in your wrapper? Or must we add a configure test > for the presence of r

Re: [HACKERS] psql and readline

2003-02-13 Thread Tom Lane
Patrick Welche <[EMAIL PROTECTED]> writes: > The sad thing is that my readline wrapper for libedit doesn't wrap > replace_history_entry, Well, is that a bug in your wrapper? Or must we add a configure test for the presence of replace_history_entry()? regards, tom lane --

Re: [HACKERS] psql and readline

2003-02-13 Thread Patrick Welche
The sad thing is that my readline wrapper for libedit doesn't wrap replace_history_entry, so I could use readline up until now, the tests for readline succeed as the functions tested for exist, but command.o: In function `do_edit': /usr/src/local/pgsql/src/bin/psql/command.c:1652: undefined refere

Re: [HACKERS] psql and readline

2003-02-12 Thread Bruce Momjian
Patch applied. Thanks. --- Ross J. Reedstrom wrote: > On Fri, Jan 10, 2003 at 11:02:55PM +0100, Peter Eisentraut wrote: > > Ross J. Reedstrom writes: > > > > > I already posted a one-line patch to implement this, but it d

Re: [HACKERS] psql and readline

2003-02-03 Thread Bruce Momjian
Your patch has been added to the PostgreSQL unapplied patches list at: http://momjian.postgresql.org/cgi-bin/pgpatches I will try to apply it within the next 48 hours. --- Ross J. Reedstrom wrote: > On Fri, Jan 10

Re: [HACKERS] psql and readline

2003-01-15 Thread Peter Eisentraut
Eric B.Ridge writes: > What about expanding the history capabilities of psql's history command > (\s) to include something more bash/tcsh-like? For example: > !insert >-- execute the last command that began with "insert" > !23 >-- execute item #23 in my history If you per

Re: [HACKERS] psql and readline

2003-01-14 Thread Eric B . Ridge
I've been following this thread, and I thought this might be a good place and time to throw in a few additional feature requests. What about expanding the history capabilities of psql's history command (\s) to include something more bash/tcsh-like? For example: !insert -- execute the

Re: [HACKERS] psql and readline

2003-01-10 Thread Ross J. Reedstrom
On Fri, Jan 10, 2003 at 11:02:55PM +0100, Peter Eisentraut wrote: > Ross J. Reedstrom writes: > > > I already posted a one-line patch to implement this, but it doesn't > > seem to hve come through to the list. Here it is inline, instead of as > > an attachment: > > We need this to work without re

Re: [HACKERS] psql and readline

2003-01-10 Thread Peter Eisentraut
Ross J. Reedstrom writes: > I already posted a one-line patch to implement this, but it doesn't > seem to hve come through to the list. Here it is inline, instead of as > an attachment: We need this to work without readline as well. (Of course there won't be any history, but it needs to compile.

Re: [HACKERS] psql and readline

2003-01-09 Thread Ross J. Reedstrom
On Fri, Jan 10, 2003 at 07:15:34AM +, Peter Mount wrote: > On Thu, 9 Jan 2003, Peter Eisentraut wrote: > > > Tom Lane writes: > > > > > The case I find interesting is where you're using plain "\e" to > > > re-edit a query interactively. If this query never gets into the > > > history buffer

Re: [HACKERS] psql and readline

2003-01-09 Thread Peter Mount
On Thu, 9 Jan 2003, Peter Eisentraut wrote: > Tom Lane writes: > > > The case I find interesting is where you're using plain "\e" to > > re-edit a query interactively. If this query never gets into the > > history buffer then you're lost: you won't be able to pull it back > > for re-editing a se

Re: [HACKERS] psql and readline

2003-01-09 Thread Ross J. Reedstrom
On Thu, Jan 09, 2003 at 10:49:33PM +0100, Peter Eisentraut wrote: > Christopher Kings-Lynne writes: > > > Is there any way of making the 'up' arrow retrieve all of the last multiline > > query, instead of just the last line? > > There is nothing technical that should prevent you from implementing

Re: [HACKERS] psql and readline

2003-01-09 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > Tom Lane writes: >> The case I find interesting is where you're using plain "\e" to >> re-edit a query interactively. If this query never gets into the >> history buffer then you're lost: you won't be able to pull it back >> for re-editing a second ti

Re: [HACKERS] psql and readline

2003-01-09 Thread Peter Eisentraut
Christopher Kings-Lynne writes: > Is there any way of making the 'up' arrow retrieve all of the last multiline > query, instead of just the last line? There is nothing technical that should prevent you from implementing it. But you need to come up with a reasonable system to keep the history stra

Re: [HACKERS] psql and readline

2003-01-09 Thread Peter Eisentraut
Tom Lane writes: > The case I find interesting is where you're using plain "\e" to > re-edit a query interactively. If this query never gets into the > history buffer then you're lost: you won't be able to pull it back > for re-editing a second time. If you call \e again immediately then you edi

Re: [HACKERS] psql and readline

2003-01-09 Thread Jean-Paul ARGUDO
On Wed, 2003-01-08 at 15:30, Christopher Kings-Lynne wrote: > > > Is there any way of making the 'up' arrow retrieve all of the last multiline > > > query, instead of just the last line? It's really annoying working with > > > large multiline queries at the moment... You could use ledit, piped wi

Re: [HACKERS] psql and readline

2003-01-09 Thread Peter Mount
On Thu, 9 Jan 2003, Bruce Momjian wrote: > Rod Taylor wrote: > > I'd tend to switch it to store \E QUERY BUFFER in the history, and > > possibly remove the ability to use \e by itself -- or make \E FILENAME > > and \e QUERY BUFFER. > > > > Since the use of \e isn't likely to be used in a programm

Re: [HACKERS] psql and readline

2003-01-09 Thread Justin Clift
Hi guys, As a curiosity thought, would it be possible to do something like: \ep Where this tells psql to get the query in the history prior to the \e, and edit it interactively? :-) Regards and best wishes, Justin Clift -- "My grandfather once told me that there are two kinds of people: tho

Re: [HACKERS] psql and readline

2003-01-09 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Rod Taylor wrote: >> Since the use of \e isn't likely to be used in a programmatic >> (automated) way, but only by users who could quickly figure it out. > I don't think it makes sense to remove \e just to add history > functionality. Indeed, that would

Re: [HACKERS] psql and readline

2003-01-09 Thread Bruce Momjian
Rod Taylor wrote: > I'd tend to switch it to store \E QUERY BUFFER in the history, and > possibly remove the ability to use \e by itself -- or make \E FILENAME > and \e QUERY BUFFER. > > Since the use of \e isn't likely to be used in a programmatic > (automated) way, but only by users who could qu

Re: [HACKERS] psql and readline

2003-01-09 Thread Rod Taylor
On Thu, 2003-01-09 at 10:42, Peter Mount wrote: > On 9 Jan 2003, Rod Taylor wrote: > > > On Thu, 2003-01-09 at 10:12, Justin Clift wrote: > > > Bruce Momjian wrote: > > > > > > > Let's suppose I am writing a query, and then I do \e to edit the query, > > > > and I exit the editor and return to ps

Re: [HACKERS] psql and readline

2003-01-09 Thread Peter Mount
On 9 Jan 2003, Rod Taylor wrote: > On Thu, 2003-01-09 at 10:12, Justin Clift wrote: > > Bruce Momjian wrote: > > > > > Let's suppose I am writing a query, and then I do \e to edit the query, > > > and I exit the editor and return to psql. Suppose I decide I want to > > > reedit, so I up arrow.

Re: [HACKERS] psql and readline

2003-01-09 Thread cbbrowne
On Thu, 09 Jan 2003 10:13:14 EST, the world broke into rejoicing as Bruce Momjian <[EMAIL PROTECTED]> said: > Justin Clift wrote: > > Bruce Momjian wrote: > > > > > Let's suppose I am writing a query, and then I do \e to edit the query, > > > and I exit the editor and return to psql. Suppose I d

Re: [HACKERS] psql and readline

2003-01-09 Thread Rod Taylor
On Thu, 2003-01-09 at 10:12, Justin Clift wrote: > Bruce Momjian wrote: > > > Let's suppose I am writing a query, and then I do \e to edit the query, > > and I exit the editor and return to psql. Suppose I decide I want to > > reedit, so I up arrow. I would expect to get \e, not the query I just

Re: [HACKERS] psql and readline

2003-01-09 Thread Dan Langille
On 9 Jan 2003 at 10:13, Bruce Momjian wrote: > Justin Clift wrote: > > Bruce Momjian wrote: > > > > > Let's suppose I am writing a query, and then I do \e to edit the > > > query, and I exit the editor and return to psql. Suppose I decide > > > I want to reedit, so I up arrow. I would expect to

Re: [HACKERS] psql and readline

2003-01-09 Thread Peter Mount
On Fri, 10 Jan 2003, Justin Clift wrote: > Bruce Momjian wrote: > > > Let's suppose I am writing a query, and then I do \e to edit the query, > > and I exit the editor and return to psql. Suppose I decide I want to > > reedit, so I up arrow. I would expect to get \e, not the query I just > > ed

Re: [HACKERS] psql and readline

2003-01-09 Thread Bruce Momjian
Justin Clift wrote: > Bruce Momjian wrote: > > > Let's suppose I am writing a query, and then I do \e to edit the query, > > and I exit the editor and return to psql. Suppose I decide I want to > > reedit, so I up arrow. I would expect to get \e, not the query I just > > edited, no? > > Wouldn'

Re: [HACKERS] psql and readline

2003-01-09 Thread Justin Clift
Bruce Momjian wrote: Let's suppose I am writing a query, and then I do \e to edit the query, and I exit the editor and return to psql. Suppose I decide I want to reedit, so I up arrow. I would expect to get \e, not the query I just edited, no? Wouldn't it depend on how this gets implemented?

Re: [HACKERS] psql and readline

2003-01-09 Thread Bruce Momjian
Justin Clift wrote: > Dan Langille wrote: > > > As this is changing existing behaviour, I think adding an optional > > switch to revert to the old behaviour is a good idea. > > Two thoughts: > > a) Is it possible to change the behavior of the history as we're > discussing? Haven't heard Pete

Re: [HACKERS] psql and readline

2003-01-09 Thread Dan Langille
resent with my real mail address... On 9 Jan 2003 at 13:45, Peter Mount wrote: > On Wed, 8 Jan 2003, Dan Langille wrote: > > > On 8 Jan 2003 at 12:28, Bruce Momjian wrote: > > > > > Tom Lane wrote: > > > > "Alexander M. Pravking" <[EMAIL PROTECTED]> writes: > > > > > On Wed, Jan 08, 2003 at 10:

Re: [HACKERS] psql and readline

2003-01-09 Thread Justin Clift
Justin Clift wrote: b) Do we really want to go to the effort of adding a switch to revert to previous behaviour for something like this? It's almost definitely a win to have \e commands appear in the history, and seems a bit to trivial for adding switches for. Bad wording there... "\e command

Re: [HACKERS] psql and readline

2003-01-09 Thread Justin Clift
Dan Langille wrote: As this is changing existing behaviour, I think adding an optional switch to revert to the old behaviour is a good idea. Two thoughts: a) Is it possible to change the behavior of the history as we're discussing? Haven't heard Peter's response to this. b) Do we really wa

Re: [HACKERS] psql and readline

2003-01-09 Thread Dan Langille
On 9 Jan 2003 at 9:15, Robert Treat wrote: > On Thu, 2003-01-09 at 08:45, Peter Mount wrote: > > On Wed, 8 Jan 2003, Dan Langille wrote: > > > On 8 Jan 2003 at 12:28, Bruce Momjian wrote: > > > > Tom Lane wrote: > > > > > "Alexander M. Pravking" <[EMAIL PROTECTED]> writes: > > > > > > On Wed, Jan

Re: [HACKERS] psql and readline

2003-01-09 Thread Robert Treat
On Thu, 2003-01-09 at 08:45, Peter Mount wrote: > On Wed, 8 Jan 2003, Dan Langille wrote: > > On 8 Jan 2003 at 12:28, Bruce Momjian wrote: > > > Tom Lane wrote: > > > > "Alexander M. Pravking" <[EMAIL PROTECTED]> writes: > > > > > On Wed, Jan 08, 2003 at 10:53:51AM +0100, Ian Barwick wrote: > > > >

Re: [HACKERS] psql and readline

2003-01-09 Thread Peter Mount
On Wed, 8 Jan 2003, Dan Langille wrote: > On 8 Jan 2003 at 12:28, Bruce Momjian wrote: > > > Tom Lane wrote: > > > "Alexander M. Pravking" <[EMAIL PROTECTED]> writes: > > > > On Wed, Jan 08, 2003 at 10:53:51AM +0100, Ian Barwick wrote: > > > >> On Wednesday 08 January 2003 07:55, Christopher King

Re: [HACKERS] psql and readline

2003-01-08 Thread Dan Langille
On 8 Jan 2003 at 12:28, Bruce Momjian wrote: > Tom Lane wrote: > > "Alexander M. Pravking" <[EMAIL PROTECTED]> writes: > > > On Wed, Jan 08, 2003 at 10:53:51AM +0100, Ian Barwick wrote: > > >> On Wednesday 08 January 2003 07:55, Christopher Kings-Lynne > > >> wrote: > > >>> Is there any way of mak

Re: [HACKERS] psql and readline

2003-01-08 Thread Bruce Momjian
Tom Lane wrote: > "Alexander M. Pravking" <[EMAIL PROTECTED]> writes: > > On Wed, Jan 08, 2003 at 10:53:51AM +0100, Ian Barwick wrote: > >> On Wednesday 08 January 2003 07:55, Christopher Kings-Lynne wrote: > >>> Is there any way of making the 'up' arrow retrieve all of the last > >>> multiline que

Re: [HACKERS] psql and readline

2003-01-08 Thread Tom Lane
"Alexander M. Pravking" <[EMAIL PROTECTED]> writes: > On Wed, Jan 08, 2003 at 10:53:51AM +0100, Ian Barwick wrote: >> On Wednesday 08 January 2003 07:55, Christopher Kings-Lynne wrote: >>> Is there any way of making the 'up' arrow retrieve all of the last >>> multiline query, instead of just the la

Re: [HACKERS] psql and readline

2003-01-08 Thread Christopher Kings-Lynne
> > Is there any way of making the 'up' arrow retrieve all of the last multiline > > query, instead of just the last line? It's really annoying working with > > large multiline queries at the moment... > > When you say multiline do you mean this: > > template1=$ select * from > template1-$ abc a >

Re: [HACKERS] psql and readline

2003-01-08 Thread Gavin Sherry
On Wed, 8 Jan 2003, Christopher Kings-Lynne wrote: > Hi, > > Is there any way of making the 'up' arrow retrieve all of the last multiline > query, instead of just the last line? It's really annoying working with > large multiline queries at the moment... When you say multiline do you mean this:

Re: [HACKERS] psql and readline

2003-01-08 Thread Ian Barwick
On Wednesday 08 January 2003 13:02, Alexander M. Pravking wrote: > On Wed, Jan 08, 2003 at 10:53:51AM +0100, Ian Barwick wrote: > > On Wednesday 08 January 2003 07:55, Christopher Kings-Lynne wrote: > > > Hi, > > > > > > Is there any way of making the 'up' arrow retrieve all of the last > > > multi

Re: [HACKERS] psql and readline

2003-01-08 Thread Alexander M. Pravking
On Wed, Jan 08, 2003 at 10:53:51AM +0100, Ian Barwick wrote: > On Wednesday 08 January 2003 07:55, Christopher Kings-Lynne wrote: > > Hi, > > > > Is there any way of making the 'up' arrow retrieve all of the last > > multiline query, instead of just the last line? It's really annoying > > working

Re: [HACKERS] psql and readline

2003-01-08 Thread Ian Barwick
On Wednesday 08 January 2003 07:55, Christopher Kings-Lynne wrote: > Hi, > > Is there any way of making the 'up' arrow retrieve all of the last > multiline query, instead of just the last line? It's really annoying > working with large multiline queries at the moment... Not that I know of, but yo

[HACKERS] psql and readline

2003-01-07 Thread Christopher Kings-Lynne
Hi, Is there any way of making the 'up' arrow retrieve all of the last multiline query, instead of just the last line? It's really annoying working with large multiline queries at the moment... Chris ---(end of broadcast)--- TIP 2: you can get of