Re: [PATCH] psql: tab completion for ALTER ROLE ... IN DATABASE ...
| От | zengman |
|---|---|
| Тема | Re: [PATCH] psql: tab completion for ALTER ROLE ... IN DATABASE ... |
| Дата | |
| Msg-id | tencent_570729007E2B2BF4741F3737@qq.com обсуждение |
| Ответ на | Re: [PATCH] psql: tab completion for ALTER ROLE ... IN DATABASE ... (VASUKI M <vasukianand0119@gmail.com>) |
| Ответы |
Re: [PATCH] psql: tab completion for ALTER ROLE ... IN DATABASE ...
|
| Список | pgsql-hackers |
> Added a safety guard before calling PQescapeLiteral() to ensure pset.db is non-NULL and in CONNECTION_OK state,
fallingback to ALL otherwise.
Hi, VASUKI M
I just looked at this patch and thought about it briefly, but I'm a little confused about the purpose of this
conditionalcheck.
If the condition is met, then returning anything at this point makes no sense, right?
```
if (!pset.db || PQstatus(pset.db) != CONNECTION_OK)
{
COMPLETE_WITH("ALL");
}
```
Furthermore, I believe this should be guaranteed by the function `exec_query`.
```
COMPLETE_WITH_QUERY_PLUS -> COMPLETE_WITH_QUERY_LIST -> complete_from_query -> exec_query
```
However, I haven't had time to debug it yet, so I might need your help to double-check it.
--
Regards,
Man Zeng
www.openhalo.org
В списке pgsql-hackers по дате отправления: