From: Alvaro Herrera <alvherre@dcc.uchile.cl>
To: Mario Soto Cordones <msotocl@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin@postgresql.org
Subject: Re: catalog of postgres
Date: Wed, 27 Apr 2005 16:41:01 -0400
Message-ID: <20050427204101.GD27525@dcc.uchile.cl> (raw)
In-Reply-To: <e9b17cde0504271257313a0ff0@mail.gmail.com>
References: <e9b17cde050427110228170cf3@mail.gmail.com>
<20050427180931.GC27525@dcc.uchile.cl>
<e9b17cde050427111471ef2bb3@mail.gmail.com>
<24929.1114626587@sss.pgh.pa.us>
<e9b17cde0504271257313a0ff0@mail.gmail.com>
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[@]dcc.uchile.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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: alvherre@dcc.uchile.cl, msotocl@gmail.com, tgl@sss.pgh.pa.us
Subject: Re: catalog of postgres
In-Reply-To: <20050427204101.GD27525@dcc.uchile.cl>
References: <e9b17cde050427110228170cf3@mail.gmail.com> <20050427180931.GC27525@dcc.uchile.cl> <e9b17cde050427111471ef2bb3@mail.gmail.com> <24929.1114626587@sss.pgh.pa.us> <e9b17cde0504271257313a0ff0@mail.gmail.com> <20050427204101.GD27525@dcc.uchile.cl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox