From: Lyubomir Petrov <lpetrov@sysmaster.com>
To: Mario Soto Cordones <msotocl@gmail.com>
Cc: Alvaro Herrera <alvherre@dcc.uchile.cl>
Cc: pgsql-admin@postgresql.org
Subject: Re: catalog of postgres
Date: Wed, 27 Apr 2005 11:35:58 -0700
Message-ID: <426FDB8E.8010408@sysmaster.com> (raw)
In-Reply-To: <e9b17cde050427111471ef2bb3@mail.gmail.com>
References: <e9b17cde050427110228170cf3@mail.gmail.com>
<20050427180931.GC27525@dcc.uchile.cl>
<e9b17cde050427111471ef2bb3@mail.gmail.com>
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');" | sed -e 's/r$/v/'
relname | relkind
---------+---------
table1 | r
view1 | r
(2 rows)
But I believe this is a feature, not a bug. Look at this, it is
explained here
http://www.postgresql.org/docs/8.0/static/catalog-pg-class.html.
Regards,
Lyubomir Petrov
Mario Soto Cordones wrote:
>OK but views and tables for example have the same one relkind
>
>thank
>
>
>
>2005/4/27, Alvaro Herrera <alvherre@dcc.uchile.cl>:
>
>
>>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 Herrera (<alvherre[@]dcc.uchile.cl>)
>>"El día que dejes de cambiar dejarás de vivir"
>>
>>
>>
>
>
>
>
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: lpetrov@sysmaster.com, msotocl@gmail.com, alvherre@dcc.uchile.cl
Subject: Re: catalog of postgres
In-Reply-To: <426FDB8E.8010408@sysmaster.com>
References: <e9b17cde050427110228170cf3@mail.gmail.com> <20050427180931.GC27525@dcc.uchile.cl> <e9b17cde050427111471ef2bb3@mail.gmail.com> <426FDB8E.8010408@sysmaster.com>
* 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