Skip site navigation (1) Skip section navigation (2)

Re: Eliminate information_schema from oid2name listing

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Kenji Sugita <sugita(at)srapc1327(dot)sra(dot)co(dot)jp>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Eliminate information_schema from oid2name listing
Date: 2003-07-24 04:03:11
Message-ID: 200307240403.h6O43B826216@candle.pha.pa.us (view raw or flat)
Thread:
Lists: 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(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

pgsql-patches by date

Next:From: Bruce MomjianDate: 2003-07-24 04:08:07
Subject: Re: [HACKERS] PATCH: Memory leaks on start-up
Previous:From: Bruce MomjianDate: 2003-07-24 04:01:43
Subject: Re: Eliminate information_schema from oid2name listing

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group