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

Re: Trailing semicolons in psql patch

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: greg(at)turnstep(dot)com, pgsql-patches(at)postgresql(dot)org
Subject: Re: Trailing semicolons in psql patch
Date: 2001-09-30 00:04:35
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
> greg(at)turnstep(dot)com writes:
> > Since there is no reason to have a table named "mytable;"
> > why not just have psql do the smart thing and silently
> > strip the trailing semicolons?
> "Stripping" semicolons is one thing, accepting semicolons as command
> separators is another.  Your patch seems to handle the case of
> \d mytable;
> but it doesn't handle any of
> \d mytable; \d yourtable
> \d mytable;<space>
> \d mytable; select * from mytable;
> Anything short of that plus...
> > The attached patch only addresses
> > a few backslash commands as a proof of concept,
> just going to create some other confusion in place of the current
> one.

My assumption is that the semicolons used with backslash commands are
just knee-jerk adding of semicolons to the end, not attempts to actually
string backslash commands togeter.   His patch does catch those cases. 
The basic issue is that I think we can conclude that any trailing
semicolon on a line with a backslash command can be dropped.  In fact, I
wouldn't want to catch any of the items you listed above.  Let them fail.

We all do this by accident, don't we?  I know I do.

  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-patches by date

Next:From: Tom LaneDate: 2001-09-30 00:13:45
Subject: Re: Trailing semicolons in psql patch
Previous:From: Bruce MomjianDate: 2001-09-30 00:01:38
Subject: Re: More fixes for missing double quotes in the shell

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