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

Re: [HACKERS] psql and comments

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Thomas Lockhart <lockhart(at)alumni(dot)caltech(dot)edu>
Cc: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Postgres Hackers List <hackers(at)postgreSQL(dot)org>
Subject: Re: [HACKERS] psql and comments
Date: 1999-11-30 00:31:20
Message-ID: 199911300031.TAA18561@candle.pha.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
This is fixed in the current source tree.

> > > The following example shows psql correctly clearing its input buffer
> > > when a line containing *only* a comment is seen, but not completely
> > > clearing the buffer (or not realizing that it is cleared; note the
> > > changed prompt) if the comment is at the end of a valid query.
> > >
> > > postgres=> -- comment
> > > postgres=> select 'hi'; -- comment
> > > ?column?
> > > --------
> > > hi
> > > (1 row)
> > >
> > > postgres->
> > But aren't they _in_ a new statement, that begins with '--'?
> 
> ?? Sure, that's what psql thinks. But the first case shown above
> should also begin a new statement, changing the prompt (it doesn't,
> because after stripping the comment there are zero blanks in the
> line). I don't think that is the right behavior though.
> 
> Things aren't a big problem the way they stand, but istm that a
> completely blank line (after stripping single-line comments) may as
> well be the same as an empty line,and that psql could figure that out.
> 
>                     - Thomas
> 
> -- 
> Thomas Lockhart				lockhart(at)alumni(dot)caltech(dot)edu
> South Pasadena, California
> 


-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist(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: Hiroshi InoueDate: 1999-11-30 00:34:03
Subject: RE: [HACKERS] Re: [GENERAL] drop/rename table and transactions
Previous:From: Bruce MomjianDate: 1999-11-30 00:29:05
Subject: Re: [HACKERS] union and LIMIT problem

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