From: | Andres Freund <andres(at)anarazel(dot)de> |
---|---|
To: | Michael Paquier <michael(dot)paquier(at)gmail(dot)com> |
Cc: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: psql tab completion bug for ALL IN TABLESPACE |
Date: | 2015-12-14 12:08:59 |
Message-ID: | 20151214120858.GF14789@awork2.anarazel.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On 2015-12-14 20:58:21 +0900, Michael Paquier wrote:
> On Mon, Dec 14, 2015 at 8:49 PM, Andres Freund <andres(at)anarazel(dot)de> wrote:
> > On 2015-12-14 20:44:20 +0900, Michael Paquier wrote:
> >> + /*
> >> + * ALTER TABLE,INDEX,MATERIALIZED VIEW ALL IN TABLESPACE xxx OWNED BY xxx
> >> + * SET TABLESPACE.
> >> + */
> >> + else if (pg_strcasecmp(prev9_wd, "ALL") == 0 &&
> >> + pg_strcasecmp(prev8_wd, "IN") == 0 &&
> >> + pg_strcasecmp(prev7_wd, "TABLESPACE") == 0 &&
> >> + pg_strcasecmp(prev5_wd, "OWNED") == 0 &&
> >> + pg_strcasecmp(prev4_wd, "BY") == 0 &&
> >> + pg_strcasecmp(prev2_wd, "SET") == 0 &&
> >> + pg_strcasecmp(prev_wd, "TABLESPACE") == 0)
> >> + {
> >> + COMPLETE_WITH_QUERY(Query_for_list_of_tablespaces);
> >> + }
> >
> > Isn't that already handled by the normal SET TABLESPACE case?
>
> No, There is no SET TABLESPACE case, there is a TABLE SET TABLESPACE
> though. Just removing the TABLE seems to be fine..
ALTER TABLE ALL IN TABLESPACE pg_default OWNED BY andres SET TABLESPACE <tab>
works, because of
/*
* Finally, we look through the list of "things", such as TABLE, INDEX and
* check if that was the previous word. If so, execute the query to get a
* list of them.
*/
else
{
int i;
for (i = 0; words_after_create[i].name; i++)
{
if (pg_strcasecmp(prev_wd, words_after_create[i].name) == 0)
{
if (words_after_create[i].query)
COMPLETE_WITH_QUERY(words_after_create[i].query);
else if (words_after_create[i].squery)
COMPLETE_WITH_SCHEMA_QUERY(*words_after_create[i].squery,
NULL);
break;
}
}
}
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2015-12-14 12:25:01 | Re: extend pgbench expressions with functions |
Previous Message | Michael Paquier | 2015-12-14 11:58:21 | Re: psql tab completion bug for ALL IN TABLESPACE |