Re: Eliminate information_schema from oid2name listing - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: Eliminate information_schema from oid2name listing
Date
Msg-id 200307240403.h6O43B826216@candle.pha.pa.us
Whole thread Raw
In response to Eliminate information_schema from oid2name listing  (Kenji Sugita <sugita@srapc1327.sra.co.jp>)
List pgsql-patches
Sorry, patch removed from patch queue.

I will rework the patch to skip views completely, OK?

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

Kenji Sugita wrote:
> This small patch eliminates relations in information_schema from oid2name
> listing.

> Index: oid2name.c
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/contrib/oid2name/oid2name.c,v
> retrieving revision 1.18
> diff -u -r1.18 oid2name.c
> --- oid2name.c    14 May 2003 03:25:56 -0000    1.18
> +++ oid2name.c    21 Jul 2003 03:49:57 -0000
> @@ -355,7 +355,10 @@
>      if (systables == 1)
>          snprintf(todo, 1024, "select relfilenode,relname from pg_class order by relname");
>      else
> -        snprintf(todo, 1024, "select relfilenode,relname from pg_class where relname not like 'pg_%%' order by
relname");
> +        snprintf(todo, 1024, "select relfilenode,relname "
> +                 "from pg_class c, pg_namespace n "
> +                 "where c.relnamespace = n.oid and n.nspname != 'information_schema' and c.relname not like 'pg_%%'
"
> +                 "order by c.relname");
>
>      sql_exec(conn, todo, 0);
>  }

>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend

--
  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: Bruce Momjian
Date:
Subject: Re: Eliminate information_schema from oid2name listing
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] PATCH: Memory leaks on start-up