Skip site navigation (1) Skip section navigation (2)

Re: psql misbehaves because of a simple typo

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Serguei Mokhov <sa_mokho(at)alcor(dot)concordia(dot)ca>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: psql misbehaves because of a simple typo
Date: 2001-12-28 04:35:13
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > OK, so what do we want to do?  Clearing the buffer on a any backslash
> > command is clearly not what we want to do.  Should we clear the buffer
> > on a backslash command _only_ if the number of paren's is not even?  If
> > we don't clear the counter on a backslash command with uneven parens, do
> > we risk trapping people in psql?
> "Trap"?  AFAIK \q works in any case.
> \r should reset both the buffer and the counter, and seems to do so,
> though I'm not quite seeing where it manages to accomplish the latter
> (command.c only resets query_buf).  \e should probably provoke a

See mainloop.c, line 450.  Any backshash command resets the counter.

> recomputation of paren_level after the edit occurs.  Offhand I do not
> think that any other backslash commands should reset either the buffer
> or the counter.  Peter, your thoughts?

Re-doing it for the editor is interesting.  The other items like quotes
and stuff should also probably be recomputed too.

  Bruce Momjian                        |
  pgman(at)candle(dot)pha(dot)pa(dot)us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

In response to


pgsql-hackers by date

Next:From: Bruce MomjianDate: 2001-12-28 04:42:59
Subject: Re: psql misbehaves because of a simple typo
Previous:From: Tom LaneDate: 2001-12-28 04:33:27
Subject: Re: psql misbehaves because of a simple typo

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group