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
 

Reply via email to