Re: small psql patch - show Schema name for \dt \dv \dS

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-patches(at)postgresql(dot)org
Subject: Re: small psql patch - show Schema name for \dt \dv \dS
Date: 2002-08-10 19:58:54
Message-ID: 200208101958.g7AJwst16147@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

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

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2002-08-10 20:29:48 Re: clean up assertion code
Previous Message Christopher Kings-Lynne 2002-08-10 09:58:17 Re: Proposal: stand-alone composite types