Re: How do I trigger the re-creation of a crosstab-type

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: How do I trigger the re-creation of a crosstab-type
Дата
Msg-id 40883797.8000202@joeconway.com
обсуждение исходный текст
Ответ на How do I trigger the re-creation of a crosstab-type view  (George Weaver <gweaver@shaw.ca>)
Список pgsql-novice
George Weaver wrote:
> I have created a function that creates a view.  The function is
> designed to use the distinct values of one column of an existing view
> to create a new view with the distinct values forming the columns in
> the new view for aggregation purposes (type of crosstab).  When the
> function is invoked, it creates the new view.
>
> The existing view the function works from is a summary view that
> draws from numerous tables in the database.  It is for viewing
> information only, i.e. no edit, delete, or update functionality.
>
> What I would like help with is the mechanism I should use to
> determine when there is a new distinct value in the column that is
> being pivoted.  When this happens the function needs to be invoked to
> recreate the view incorporating the new column.

Possibly you could use crosstab() (from contrib/tablefunc) which would
do this for you dynamically?

Joe


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

Предыдущее
От: George Weaver
Дата:
Сообщение: How do I trigger the re-creation of a crosstab-type view
Следующее
От: "Derrick Betts"
Дата:
Сообщение: Transaction speed