weird view failure - Mailing list pgsql-sql

From Rob Casson
Subject weird view failure
Date
Msg-id Pine.LNX.4.02.9908050845490.10102-100000@screamer.lib.muohio.edu
Whole thread Raw
List pgsql-sql
new to list....

i have a perfectly valid sql statement that returns expected results, but
when i create a view based on the same sql, i get nada. similar views all
work correctly:

an example (to return primary keys):

SELECT  pg_class.relname, pg_attribute.attname       FROM pg_class, pg_attribute, pg_index       WHERE pg_class.oid =
pg_attribute.attrelidAND       pg_class.oid = pg_index.indrelid AND       pg_index.indkey[0] = pg_attribute.attnum AND
    pg_index.indisprimary = 't';
 

relname        |attname
---------------+-------
active_sessions|sid
auth_user      |uid
arraytest      |control
(3 rows)

but w/ this:

CREATE VIEW blah AS
SELECT  pg_class.relname, pg_attribute.attname       FROM pg_class, pg_attribute, pg_index       WHERE pg_class.oid =
pg_attribute.attrelidAND       pg_class.oid = pg_index.indrelid AND       pg_index.indkey[0] = pg_attribute.attnum AND
    pg_index.indisprimary = 't';
 

SELECT * FROM blah;

relname|attname
-------+-------
(0 rows)


any pointers....i've seen reference to this in the list
archives, but no leads....never really thought of creating all of this
stuff as views....still pretty green, i guess.

tia,
rob




pgsql-sql by date:

Previous
From: DE VOLDER Fabrice
Date:
Subject: unsuscribe
Next
From: MESZAROS Attila
Date:
Subject: qurey plan and indices