Re: [ADMIN] catalog of postgres

2005-04-27 Thread Alvaro Herrera
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_

Re: [ADMIN] catalog of postgres

2005-04-27 Thread Mario Soto Cordones
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, p

Re: [ADMIN] catalog of postgres

2005-04-27 Thread Goulet, Dick
N' AS VARCHAR(18)) as object_type , CAST(NULL AS DATE) AS created , CAST('VALID' AS VARCHAR(7)) AS status FROM pg_proc p WHERE p.oid > 18655; -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lyubomir Petrov Sent: Wednes

Re: [ADMIN] catalog of postgres

2005-04-27 Thread Lyubomir Petrov
Yeah, same here... Here is a test case where tables and views show up with the same relkind... :) $ psql test -c "create table table1(id int); create view view1 as select * from table1;" CREATE VIEW $ psql test -c "select relname, relkind from pg_class where relname in ('table1', 'view1');" |

Re: [ADMIN] catalog of postgres

2005-04-27 Thread Tom Lane
Mario Soto Cordones <[EMAIL PROTECTED]> 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 ---(end of broadcast)---

Re: [ADMIN] catalog of postgres

2005-04-27 Thread Mario Soto Cordones
OK but views and tables for example have the same one relkind thank 2005/4/27, Alvaro Herrera <[EMAIL PROTECTED]>: > On Wed, Apr 27, 2005 at 02:02:09PM -0400, Mario Soto Cordones wrote: > > > with this query I obtain the schema name and the objects of this it , but > > like I can know that t

Re: [ADMIN] catalog of postgres

2005-04-27 Thread Alvaro Herrera
On Wed, Apr 27, 2005 at 02:02:09PM -0400, Mario Soto Cordones wrote: > with this query I obtain the schema name and the objects of this it , but > like I can know that they are, that is to say if they are tables, > views, functions, sequences, etc See pg_class.relkind. -- Alvaro Herre

[ADMIN] catalog of postgres

2005-04-27 Thread Mario Soto Cordones
Hi guys i have a following query: SELECT nspname as schema, relname as objeto 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