psql - small fix in \du

Started by ANdreas Wenkover 16 years ago6 messages
#1ANdreas Wenk
a.wenk@netzmeister-st-pauli.de
1 attachment(s)

Hi,

attached you can find a very small patch for the help in psql (\?). It's
possible to use \du also as \du+ . The [+] was missing in help.

I was asking about this at the general list and Peter E. was asking me
to provide a patch. I sent the patch there but realized now, that this
was the wrong place to do so. Sorry for the flood ...

Cheers

Andy

Attachments:

psql-du.patchtext/x-diff; name=psql-du.patchDownload
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
index 5f13b8a..8a541e6 100644
--- a/src/bin/psql/help.c
+++ b/src/bin/psql/help.c
@@ -219,7 +219,7 @@ slashUsage(unsigned short int pager)
        fprintf(output, _("  \\ds[S+] [PATTERN]      list sequences\n"));
        fprintf(output, _("  \\dt[S+] [PATTERN]      list tables\n"));
        fprintf(output, _("  \\dT[S+] [PATTERN]      list data types\n"));
-       fprintf(output, _("  \\du     [PATTERN]      list roles (users)\n"));
+       fprintf(output, _("  \\du[+]  [PATTERN]      list roles (users)\n"));
        fprintf(output, _("  \\dv[S+] [PATTERN]      list views\n"));
        fprintf(output, _("  \\l[+]                  list all databases\n"));
        fprintf(output, _("  \\z      [PATTERN]      same as \\dp\n")); 
#2Andreas Wenk
a.wenk@netzmeister-st-pauli.de
In reply to: ANdreas Wenk (#1)
Re: psql - small fix in \du

ANdreas Wenk schrieb:

Hi,

attached you can find a very small patch for the help in psql (\?). It's
possible to use \du also as \du+ . The [+] was missing in help.

I was asking about this at the general list and Peter E. was asking me
to provide a patch. I sent the patch there but realized now, that this
was the wrong place to do so. Sorry for the flood ...

Cheers

Andy

As written in another post \dg misses also the [+] so I changed that. Now I recognized
that I also have to change psql-ref.sgml (sorry did not see it in help.c). So I wanted to
update it and I am now wondering, what will be written in the description row when using
\du+ or \dg+. I am not sure when the function shobj_description(oid, name) is giving a
result.

Can anybody give me a hint or a scenario so that I can update the patch correctly?

Thanks a lot

Andy

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andreas Wenk (#2)
Re: psql - small fix in \du

Andreas Wenk <a.wenk@netzmeister-st-pauli.de> writes:

I am not sure when the function shobj_description(oid, name) is giving a
result.

That retrieves the comment for the object (the role, in this case).

regards, tom lane

#4Andreas Wenk
a.wenk@netzmeister-st-pauli.de
In reply to: Tom Lane (#3)
Re: psql - small fix in \du

Tom Lane wrote:

Andreas Wenk <a.wenk@netzmeister-st-pauli.de> writes:

I am not sure when the function shobj_description(oid, name) is giving a
result.

That retrieves the comment for the object (the role, in this case).

regards, tom lane

Tom, thank you. I will provide an updated patch tomorrow.

Cheers

Andy

#5Andreas Wenk
a.wenk@netzmeister-st-pauli.de
In reply to: Tom Lane (#3)
1 attachment(s)
Re: psql - small fix in \du

Tom Lane schrieb:

Andreas Wenk <a.wenk@netzmeister-st-pauli.de> writes:

I am not sure when the function shobj_description(oid, name) is giving a
result.

That retrieves the comment for the object (the role, in this case).

regards, tom lane

attached you can find an updated patch. The changes are:

- change \du and \dg to \du+ and \dg+ in the docu
- change the same in psql/help.c
- change the translation files in psql/po

two questions on this:

- is it ok to provide all these changes in one patch?
- I did the patch with git format-patch and left the header in the patch. Ok?

Although Tom asked if the translation files should be patched at all, I sent them.

vi showed the foreign language signs in the patch utf-8 encoded and not as the character.
I imported the patch in my local master. The md5checksum was the same (e.g ja.po) an the
character are in original language. Everything was ok - so if there are problems, please
keep me informed.

Cheers

Andy

Attachments:

psql-du-and-dg-changes-including-translation.patchtext/x-patch; name=psql-du-and-dg-changes-including-translation.patchDownload
#6Peter Eisentraut
peter_e@gmx.net
In reply to: Andreas Wenk (#5)
Re: psql - small fix in \du

On Thursday 23 July 2009 13:29:51 Andreas Wenk wrote:

attached you can find an updated patch. The changes are:

- change \du and \dg to \du+ and \dg+ in the docu
- change the same in psql/help.c
- change the translation files in psql/po

Fixed, thanks.