Re: Trailing semicolons in psql patch - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: Trailing semicolons in psql patch
Date
Msg-id 200110040054.f940svb03427@candle.pha.pa.us
Whole thread Raw
In response to Re: Trailing semicolons in psql patch  (greg@turnstep.com)
List pgsql-patches
OK, any chance of getting an updated patch.  Your patch email is at:

    http://candle.pha.pa.us/cgi-bin/pgpatches


> > I agree with this premise ... but stated that way, the patch does
> > entirely the wrong thing, because it's stripping trailing semis at
> > the word level not the line level.  I think it's a lot more surprising
> > to drop the semi in
> >
> >         \x foo; bar
> >
> > than when it's actually at the end of the line.
>
> Ah...so what we want then is for all of these cases to work:
>
> \d foo \d bar
> \d foo; \d bar
> \d foo; \d bar;
> \d foo; \d bar
>
> Makes sense...I never combine backslash commands on the same line,
> but it is possible. In that case, how about just moving this section:
>
>   if (semicolon) {
>     int i;
>     for (i = strlen(options_string)-1; i && options_string[i]==';'; i--);
>      if (i<strlen(options_string)-1) options_string[i+1]='\0';
>   }
>
> to right after here, where we find a "normal word"?
>
>   strncpy(return_val, &options_string[pos], token_end);
>   return_val[token_end] = 0;
>
> (and changing options_string to return_val)
>
> that should allow us to catch all the cases above, if I am
> understanding the objection above correctly.
>
> Greg Sabino Mullane
> greg@turnstep.com PGP Key: 0x14964AC8 200110011738
-- End of PGP signed section.

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

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [PATCH] pl/tcl elog command Unicode patch
Next
From: Vsevolod Lobko
Date:
Subject: Re: [PATCH] Patch for more verbose error reporting in