From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
Cc: | Abhijit Menon-Sen <ams(at)2ndquadrant(dot)com>, Rajeev rastogi <rajeev(dot)rastogi(at)huawei(dot)com>, Samrat Revagade <revagade(dot)samrat(at)gmail(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Fabrízio Mello <fabriziomello(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: psql: show only failed queries |
Date: | 2014-08-06 21:26:08 |
Message-ID: | CAFj8pRAYtymcoe4nbLOg4sMb0gsa3pXafVHbm8WKgPJDFYd+Ng@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Hello
updated version patch in attachment
2014-08-05 13:31 GMT+02:00 Fujii Masao <masao(dot)fujii(at)gmail(dot)com>:
> On Wed, Jul 16, 2014 at 4:34 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
> >
> >
> >
> > 2014-07-15 12:07 GMT+02:00 Fujii Masao <masao(dot)fujii(at)gmail(dot)com>:
> >
> >> On Tue, Jul 15, 2014 at 7:01 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com
> >
> >> wrote:
> >> >
> >> >
> >> >
> >> > 2014-07-15 11:29 GMT+02:00 Fujii Masao <masao(dot)fujii(at)gmail(dot)com>:
> >> >
> >> >> On Thu, Jul 10, 2014 at 9:56 PM, Pavel Stehule
> >> >> <pavel(dot)stehule(at)gmail(dot)com>
> >> >> wrote:
> >> >> > Hello
> >> >> >
> >> >> > here is a proposed patch - autocomplete for known psql variable
> >> >> > content
> >> >>
> >> >> Even after applying the patch, the following psql variables were not
> >> >> displayed
> >> >> on the tab-completion of \set command.
> >> >>
> >> >> HISTFILE
> >> >> HISTSIZE
> >> >> HOST
> >> >> IGNOREEOF
> >> >> LASTOID
> >> >>
> >> >> I'm not sure if it's worth displaying all of them on the
> tab-completion
> >> >> of
> >> >> \set
> >> >> because it seems strange to change some of them by \set command, for
> >> >> example
> >> >> HOST, though.
> >> >
> >> >
> >> > For these variables are not default - so doesn't exist and cannot be
> >> > completed by default.
> >> >
> >> > there are two fix:
> >> >
> >> > a) fix autocomplete source - preferred
> >>
> >> +1
> >
> >
> > here is the patch
>
> Thanks for the patch!
>
> I got the following compiler warnings.
>
> tab-complete.c:4155: warning: assignment discards qualifiers from
> pointer target type
> tab-complete.c:4166: warning: assignment discards qualifiers from
> pointer target type
>
fixed
>
> + "FETCH_COUNT", "HISTCONTROL", "HISTFILE", "HISTSIZE", "HOST",
> "IGNOREOFF",
>
> Typo: IGNOREOFF -> IGNOREEOF
>
fixed
>
> + /* all psql known variables are included in list by default */
> + for (known_varname = known_varnames; *known_varname; known_varname++)
> + varnames[nvars++] = pg_strdup(*known_varname);
>
> Don't we need to append both prefix and suffix to even known variables?
>
??? I am not sure if I understand well - probably system "read only"
variables as DBNAME, USER, VERSION should not be there
>
> + else if (strcmp(prev2_wd, "\\set") == 0)
> + {
> + if (strcmp(prev_wd, "AUTOCOMMIT") == 0)
>
> ISTM that some psql variables like IGNOREEOF are not there. Why not?
>
yes, there are not complete for DBNAME, ENCODING, FETCH_COUNT, HISTCONTROL,
HISTFILE, HISTSIZE, HOST, IGNOREEOFF, PROMPT*,USER, VERSION
There are more reasons:
* paremeter is not a enum (string, number or both): FETCH_COUNT, PROMPT,
HISTSIZE, ..
* variable is pseudo read only - change has not any effect: DBNAME,
ENCODING, VERSION
Regards
Pavel
>
> Regards,
>
> --
> Fujii Masao
>
From | Date | Subject | |
---|---|---|---|
Next Message | Marko Tiikkaja | 2014-08-06 22:11:42 | Re: plpgsql.extra_warnings='num_into_expressions' |
Previous Message | David G Johnston | 2014-08-06 21:20:14 | Re: select_common_type()'s behavior doesn't match the documentation |