Re: Trailing semicolons in psql patch

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: greg(at)turnstep(dot)com
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Trailing semicolons in psql patch
Date: 2001-10-04 00:54:57
Message-ID: 200110040054.f940svb03427@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)turnstep(dot)com PGP Key: 0x14964AC8 200110011738
-- End of PGP signed section.

--
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

Browse pgsql-patches by date

  From Date Subject
Next Message Tatsuo Ishii 2001-10-04 02:16:42 Re: Unicode combining characters
Previous Message Bruce Momjian 2001-10-03 23:20:59 Re: [PATCH] pl/tcl elog command Unicode patch