Re: catalog of postgres

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Mario Soto Cordones <msotocl(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-admin(at)postgresql(dot)org
Subject: Re: catalog of postgres
Date: 2005-04-27 20:41:01
Message-ID: 20050427204101.GD27525@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, Apr 27, 2005 at 03:57:41PM -0400, Mario Soto Cordones wrote:

> SELECT nspname as esquema, relname as objeto,
> (CASE relkind
> WHEN 'v' THEN 'Vista'
> WHEN 'i' THEN 'Indice'
> WHEN 'S' THEN 'Secuencia'
> WHEN 'r' THEN 'Tabla'
> WHEN 'c' THEN 'Tipo'
> END) as tipo
> FROM
> pg_class bc,
> pg_attribute ta,
> pg_namespace ns,
> pg_type ty
> WHERE
> ta.attrelid = bc.oid
> and ta.attnum > 0
> and not ta.attisdropped
> and nspname <> 'information_schema' and nspname not like 'pg_%'
> ----and relam = 0
> and bc.relnamespace = ns.oid
> and bc.relname not like 'pg_%'
> and ta.atttypid = ty.oid
> group by nspname, relname, relkind
> order by tipo desc

Why are you using a group by here? It's unnecesary.

> but not you where they stay the functions

See the pg_proc catalog.

I wonder if I have pointed you to the documentation before? See the
"system catalogs" section in the internals chapter. Also, maybe you
should take a look at whether the information_schema gives you what you
want.

--
Alvaro Herrera (<alvherre[(at)]dcc(dot)uchile(dot)cl>)
Y una voz del caos me habló y me dijo
"Sonríe y sé feliz, podría ser peor".
Y sonreí. Y fui feliz.
Y fue peor.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Mauri Sahlberg 2005-04-28 06:27:30 Help desperately needed: reoccurring invalid page header
Previous Message Mario Soto Cordones 2005-04-27 19:57:41 Re: catalog of postgres