Re: small psql patch - show Schema name for \dt \dv \dS - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: small psql patch - show Schema name for \dt \dv \dS
Date
Msg-id 200208101958.g7AJwst16147@candle.pha.pa.us
Whole thread Raw
In response to Re: small psql patch - show Schema name for \dt \dv \dS  (Joe Conway <mail@joeconway.com>)
List pgsql-patches
It appears this patch was already applied, I think by Tom Lane.

Thanks.

---------------------------------------------------------------------------

Joe Conway wrote:
> Tom Lane wrote:
> > It seems rather odd and confusing that the sort order takes the second
> > column as the major key.
>
> Maybe I'm a rather odd and confused kind of guy ;-)
>
> > I think that the sort ordering should be
> > column 1 then 2.  That means either putting the schema column first,
> > or keeping this column ordering and sorting on relname before schema.
> > I lean towards the first choice but can see a case for the second.
>
> Here's another small patch, to implement Tom's first choice above. I
> looked at re-adding your own "pg_temp_n" schema back into the results.
> But I don't see a way to determine your own BackendId unless we add a
> builtin function to expose MyBackendId as a user callable function.
> Should we do this, or did I just miss something?
>
> If there are no objections, please apply.
>
> Thanks,
>
> Joe

> Index: src/bin/psql/describe.c
> ===================================================================
> RCS file: /opt/src/cvs/pgsql/src/bin/psql/describe.c,v
> retrieving revision 1.56
> diff -c -r1.56 describe.c
> *** src/bin/psql/describe.c    20 Jul 2002 05:57:31 -0000    1.56
> --- src/bin/psql/describe.c    20 Jul 2002 20:57:16 -0000
> ***************
> *** 1021,1031 ****
>       initPQExpBuffer(&buf);
>
>       printfPQExpBuffer(&buf,
> !              "SELECT c.relname as \"%s\",\n"
> !              "  n.nspname as \"%s\",\n"
>                "  CASE c.relkind WHEN 'r' THEN '%s' WHEN 'v' THEN '%s' WHEN 'i' THEN '%s' WHEN 'S' THEN '%s' WHEN 's'
THEN'%s' END as \"%s\",\n" 
>                "  u.usename as \"%s\"",
> !              _("Name"), _("Schema"), _("table"), _("view"), _("index"), _("sequence"),
>                _("special"), _("Type"), _("Owner"));
>
>       if (desc)
> --- 1021,1031 ----
>       initPQExpBuffer(&buf);
>
>       printfPQExpBuffer(&buf,
> !              "SELECT n.nspname as \"%s\",\n"
> !              "  c.relname as \"%s\",\n"
>                "  CASE c.relkind WHEN 'r' THEN '%s' WHEN 'v' THEN '%s' WHEN 'i' THEN '%s' WHEN 'S' THEN '%s' WHEN 's'
THEN'%s' END as \"%s\",\n" 
>                "  u.usename as \"%s\"",
> !              _("Schema"), _("Name"), _("table"), _("view"), _("index"), _("sequence"),
>                _("special"), _("Type"), _("Owner"));
>
>       if (desc)
> ***************
> *** 1068,1074 ****
>       if (name)
>           appendPQExpBuffer(&buf, "  AND c.relname ~ '^%s'\n", name);
>
> !     appendPQExpBuffer(&buf, "ORDER BY 2,1;");
>
>       res = PSQLexec(buf.data);
>       termPQExpBuffer(&buf);
> --- 1068,1074 ----
>       if (name)
>           appendPQExpBuffer(&buf, "  AND c.relname ~ '^%s'\n", name);
>
> !     appendPQExpBuffer(&buf, "ORDER BY 1,2;");
>
>       res = PSQLexec(buf.data);
>       termPQExpBuffer(&buf);

>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] CREATE TEMP TABLE .... ON COMMIT
Next
From: Bruce Momjian
Date:
Subject: Re: clean up assertion code