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

Re: catalog of postgres

From: Mario Soto Cordones <msotocl(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>,pgsql-admin(at)postgresql(dot)org
Subject: Re: catalog of postgres
Date: 2005-04-27 19:57:41
Message-ID: e9b17cde0504271257313a0ff0@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-admin
OK  i have a big mistake, i saw bad, now my new query is

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
  
  select * from pg_class
  where relkind = 'i'

but not you where they stay the functions

thank you for all



2005/4/27, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> Mario Soto Cordones <msotocl(at)gmail(dot)com> writes:
> > OK but views and tables for example have the same one relkind
> 
> Not for many years now (certainly not in any release that has pg_namespace).
> 
>                         regards, tom lane
> 


-- 
cordialmente,

Ing. Mario Soto Cordones

In response to

Responses

pgsql-admin by date

Next:From: Alvaro HerreraDate: 2005-04-27 20:41:01
Subject: Re: catalog of postgres
Previous:From: Magnus HaganderDate: 2005-04-27 19:41:30
Subject: Re: PostgreSQL 8.0.x on Windows XPe

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