$ 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 <[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 they are, that is to say if they are tables,
views, functions, sequences, etc ????????
See pg_class.relkind.
-- Alvaro Herrera (<[EMAIL PROTECTED]>) "El d�a que dejes de cambiar dejar�s de vivir"
---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend
