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: 200109300004.f8U04ZC09369@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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,
>
> ...is 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 | http://candle.pha.pa.us
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

Responses

Browse pgsql-patches by date

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