Distinguish view and table problem

Поиск
Список
Период
Сортировка
От suzhiyang
Тема Distinguish view and table problem
Дата
Msg-id 200912182357482650255@gmail.com
обсуждение исходный текст
Ответы Re: Distinguish view and table problem  (Filip Rembiałkowski <plk.zuber@gmail.com>)
Re: Distinguish view and table problem  (Robert Haas <robertmhaas@gmail.com>)
Re: Distinguish view and table problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Hi!
I just want to distinguish a view and a table while postgres execute exec_simple_query(). In the systable of pg_class, a view and a table has different relkind ('r' 'v'). But when I print the parsetree and the rewrite parsetree, I found that a view and a table has no character to distinguish because the structure Relation has no attribute called relkind. Maybe I should read systable to confirm that we are select from a view or table? But there's still has problem. How could I get the relkind of a table(view) by its name from pg_class?
Another question is that does postgres save the user's original query_string at anywhere(systable etc.)? If I want to save the sourceText in the systable, I could add a column to pg_class called query_string. How could I insert a line to pg_class or read a line from it?
 
Thank you very much!
 
2009-12-18

suzhiyang

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Nicolas Barbier
Дата:
Сообщение: Re: Update on true serializable techniques in MVCC
Следующее
От: Filip Rembiałkowski
Дата:
Сообщение: Re: Distinguish view and table problem