Re: [HACKERS] Changing the continuation-line prompt in psql?

2011-05-01 Thread Joshua Berkus
Dimitri, > > I'll bet someone a fancy drink at a conference that this thread goes > > to at least 100 posts. > > Of course, if we all are to argue about this bet… :) Darn! You've uncovered by sinister plan. Foiled again! -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com San Francis

Re: [HACKERS] Changing the continuation-line prompt in psql?

2011-04-30 Thread Dimitri Fontaine
Joshua Berkus writes: > I'll bet someone a fancy drink at a conference that this thread goes to at > least 100 posts. Of course, if we all are to argue about this bet… :) -- Dimitri Fontaine http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support -- Sent via pgsql-hackers mai

Re: [HACKERS] Changing the continuation-line prompt in psql?

2011-04-30 Thread Joshua Berkus
I'll bet someone a fancy drink at a conference that this thread goes to at least 100 posts. Let the bikeshedding begin! -- Josh Berkus PostgreSQL Experts Inc. http://pgexperts.com San Francisco -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subsc

Re: [HACKERS] Changing the continuation-line prompt in psql?

2011-04-30 Thread Tom Lane
Peter Eisentraut writes: > How about just making the continuation prompts empty then? Personally I'd be very annoyed to lose the %R marker (the "are you in a string literal?" flag). So I think that that's not a good default. Of course, anyone who *is* that concerned about copy&paste cases can se

Re: [HACKERS] Changing the continuation-line prompt in psql?

2011-04-30 Thread Peter Eisentraut
On fre, 2011-04-29 at 19:06 +0100, Greg Stark wrote: > I would second this precise interest. It really annoys me more often > than anything else that when I try to copy/paste an sql query I need > to copy each line one by one. It would be different from MySql but I > think it would be even clearer

Re: [HACKERS] Changing the continuation-line prompt in psql?

2011-04-29 Thread Alvaro Herrera
Excerpts from Dimitri Fontaine's message of vie abr 29 16:37:37 -0300 2011: > Tom Lane writes: > > It wasn't bothering me either initially, but the argument about the > > command looking different when you suck it into an editor with \e > > has some credibility. > > It still do not bother me the

Re: [HACKERS] Changing the continuation-line prompt in psql?

2011-04-29 Thread Dimitri Fontaine
Tom Lane writes: > It wasn't bothering me either initially, but the argument about the > command looking different when you suck it into an editor with \e > has some credibility. It still do not bother me the least, I much prefer PROMPT2 to be +>. With emacs you use M-d then a rectangular cut (C

Re: [HACKERS] Changing the continuation-line prompt in psql?

2011-04-29 Thread k...@rice.edu
On Fri, Apr 29, 2011 at 02:10:19PM -0400, Stephen Frost wrote: > * Stephen Frost (sfr...@snowman.net) wrote: > > Uhm.. With the above, perhaps "--%Z+>", which would generate: > > > > postgres=> > > -- +> > > yah, obviously not going to work. :) However, it wouldn't be impossible > to have

Re: [HACKERS] Changing the continuation-line prompt in psql?

2011-04-29 Thread Pavel Stehule
2011/4/29 Greg Stark : > On Fri, Apr 29, 2011 at 5:45 PM, Christopher Browne > wrote: >> The "bike shedding" that I'd rather have would involve enclosing >> prompts with /* comments */ so that cut'n'paste could be expected to >> generate output that could run, without further editing, in another

Re: [HACKERS] Changing the continuation-line prompt in psql?

2011-04-29 Thread Tom Lane
Greg Stark writes: > On Fri, Apr 29, 2011 at 5:45 PM, Christopher Browne > wrote: >> The "bike shedding" that I'd rather have would involve enclosing >> prompts with /* comments */ so that cut'n'paste could be expected to >> generate output that could run, without further editing, in another >>

Re: [HACKERS] Changing the continuation-line prompt in psql?

2011-04-29 Thread Stephen Frost
* Stephen Frost (sfr...@snowman.net) wrote: > Uhm.. With the above, perhaps "--%Z+>", which would generate: > > postgres=> > -- +> yah, obviously not going to work. :) However, it wouldn't be impossible to have psql recognize and strip "--+> " if/when it's seen starting a new line, if we s

Re: [HACKERS] Changing the continuation-line prompt in psql?

2011-04-29 Thread Greg Stark
On Fri, Apr 29, 2011 at 5:45 PM, Christopher Browne wrote: > The "bike shedding" that I'd rather have would involve enclosing > prompts with /* comments */ so that cut'n'paste could be expected to > generate output that could run, without further editing, in another > psql session.  Mind you, when

Re: [HACKERS] Changing the continuation-line prompt in psql?

2011-04-29 Thread Tom Lane
Christopher Browne writes: >> Excerpts from David E. Wheeler's message of vie abr 29 13:04:35 -0300 2011: >>> +1 I like this idea, so the prompt might by default be >>> >>> postgres=> >>> +> > That's certainly a reasonable sort of start. > It seems like pretty serious bikesheddi

Re: [HACKERS] Changing the continuation-line prompt in psql?

2011-04-29 Thread Stephen Frost
* Christopher Browne (cbbro...@gmail.com) wrote: > It seems like pretty serious bikeshedding to try to come up with an > operator to express "do as many of character X as the length of > variable $FOO". How about "pad with spaces to line up prompt", or such? In general, I like the idea of having

Re: [HACKERS] Changing the continuation-line prompt in psql?

2011-04-29 Thread Christopher Browne
On Fri, Apr 29, 2011 at 12:17 PM, Alvaro Herrera wrote: > Excerpts from David E. Wheeler's message of vie abr 29 13:04:35 -0300 2011: >> On Apr 29, 2011, at 8:22 AM, Tom Lane wrote: >> >> > AFAICT the initial prompt is always "mysql> ", so they don't have to >> > think hard about how many spaces t

Re: [HACKERS] Changing the continuation-line prompt in psql?

2011-04-29 Thread Alvaro Herrera
Excerpts from David E. Wheeler's message of vie abr 29 13:04:35 -0300 2011: > On Apr 29, 2011, at 8:22 AM, Tom Lane wrote: > > > AFAICT the initial prompt is always "mysql> ", so they don't have to > > think hard about how many spaces to insert to make it line up. But > > we could certainly inven

Re: [HACKERS] Changing the continuation-line prompt in psql?

2011-04-29 Thread David E. Wheeler
On Apr 29, 2011, at 8:22 AM, Tom Lane wrote: > AFAICT the initial prompt is always "mysql> ", so they don't have to > think hard about how many spaces to insert to make it line up. But > we could certainly invent a prompt escape that means "as many spaces > as there are characters in the current

Re: [HACKERS] Changing the continuation-line prompt in psql?

2011-04-29 Thread Tom Lane
Magnus Hagander writes: > On Fri, Apr 29, 2011 at 17:09, Tom Lane wrote: >> ... Two different possible changes were suggested: >> >> * Drop the database name from PROMPT2, so you see >> >>postgres=> >>-> > Definite -1 on that option - your query no longer lines up, and if you >

Re: [HACKERS] Changing the continuation-line prompt in psql?

2011-04-29 Thread Magnus Hagander
On Fri, Apr 29, 2011 at 17:09, Tom Lane wrote: > Over at > http://archives.postgresql.org/pgsql-novice/2011-04/msg00102.php > there's an interesting thread about a novice who forgot to put a > semicolon at the end of his SQL commands, and what psql might do to be > a little more friendly at the be

[HACKERS] Changing the continuation-line prompt in psql?

2011-04-29 Thread Tom Lane
Over at http://archives.postgresql.org/pgsql-novice/2011-04/msg00102.php there's an interesting thread about a novice who forgot to put a semicolon at the end of his SQL commands, and what psql might do to be a little more friendly at the beginning of the learning curve. We see similar complaints