Getting list of tables used within a query

Поиск
Список
Период
Сортировка
От Marek Lewczuk
Тема Getting list of tables used within a query
Дата
Msg-id daadfdc20907160151r790e11ah83c7df5916205bf1@mail.gmail.com
обсуждение исходный текст
Ответы Re: Getting list of tables used within a query
Список pgsql-general
Hi,
for need of our application we need to get list of tables, that are
used within given SELECT query - we need them in order to track
changes of the data, that may be returned by the query - it is some
kind of caching mechanism, that checks db data modifications. Right
now we create a temporary view and after that we use
information_schema.view_table_usage - it works fine, but it has two
disadvantages - firstly is quite slow and secondly only owner of the
tables can do that, which means that application must use two types of
connections, one for normal operations and second for getting list of
tables. Is there any other way to achieve that without need of using
owner role and without creating a view ? Browsing the PG source I see
that include/parser/.. can be used, but its quite complicated
(especially for me as I'm not to good in C programming) - maybe anyone
has some examples how to use parser to achieve my goals or maybe
someone already has got working code that does similar things ?

Best wishes,
ML

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

Предыдущее
От: Andreas Wenk
Дата:
Сообщение: Re: best practice transitioning from one datatype to another
Следующее
От: Rafael Martinez
Дата:
Сообщение: Problems with 8.4, FLOAT8PASSBYVAL and x86_64 GNU/Linux