Re: psql tab completion bug and possible fix

Поиск
Список
Период
Сортировка
От Ian Barwick
Тема Re: psql tab completion bug and possible fix
Дата
Msg-id 200310152226.38481.barwick@gmx.net
обсуждение исходный текст
Ответ на Re: psql tab completion bug and possible fix  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: psql tab completion bug and possible fix  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
On Tuesday 14 October 2003 23:38, Tom Lane wrote:
> Ian Barwick <barwick@gmx.net> writes:
> > A patch for this using PQescapeString (is there another preferred
> > method?) is attached as a possible solution.
>
> Surely all those replacements of \\ with \\\\ are wrong.

The slash in the slash command gets escaped too...:

#include <stdio.h>
#include "libpq-fe.h"

main() {
  char *s, *r;

  s = "\\d";

  printf("%s\n", s);

  r = (char *) malloc(strlen(s) * 2);
  PQescapeString(r, s, strlen(s));

  printf("%s\n", r);

  if(strcmp(r, "\\\\d") == 0) {
    printf("match\n");
  }

  free(s);
  free(r);
}

Without \\\\ tab expansion for slash commands doesn't work.

There may of course be better ways of solving this problem.


Ian Barwick
barwick@gmx.net

В списке pgsql-patches по дате отправления:

Предыдущее
От: Fabrizio Mazzoni
Дата:
Сообщение: psql-it corrected
Следующее
От: Tom Lane
Дата:
Сообщение: Re: psql tab completion bug and possible fix