weird view failure

From: Rob Casson <rcasson(at)screamer(dot)lib(dot)muohio(dot)edu>
To: pgsql-sql(at)postgresql(dot)org
Subject: weird view failure
Date: 1999-08-05 12:47:00
Message-ID: Pine.LNX.4.02.9908050845490.10102-100000@screamer.lib.muohio.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.attrelid AND
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.attrelid AND
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

Browse pgsql-sql by date

  From Date Subject
Next Message rob caSSon 1999-08-05 13:52:23 primary key view failure
Previous Message MESZAROS Attila 1999-08-05 12:08:43 qurey plan and indices