Re: Crosstab function

Поиск
Список
Период
Сортировка
Искать
От
Hengky Liwandouw
Тема
Re: Crosstab function
Дата
в 02:44:49
Msg-id
004201cf6b30$9c48c250$d4da46f0$@com
Ответ на
Список
Дерево обсуждения
Crosstab function "Hengky Liwandouw" <hengkyliwandouw@gmail.com>
Re: Crosstab function David G Johnston <david.g.johnston@gmail.com>
Re: Crosstab function "Hengky Liwandouw" <hengkyliwandouw@gmail.com>
Re: Crosstab function David G Johnston <david.g.johnston@gmail.com>
Re: Crosstab function "Hengky Liwandouw" <hengkyliwandouw@gmail.com>
Re: Crosstab function Sim Zacks <sim@compulab.co.il>
Re: Crosstab function "Hengky Liwandouw" <hengkyliwandouw@gmail.com>
Re: Crosstab function Paul Jungwirth <pj@illuminatedcomputing.com>
Re: Crosstab function Dann Corbit <DCorbit@connx.com>

Thanks Sim, a very usefull information.

 

 

From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Sim Zacks
Sent: Wednesday, May 07, 2014 7:33 PM
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Crosstab function

 

What I have done in the past to build a generic reporting application is to have the function write the results you want in a table and return the tablename and then have the client code call select * from that table.

My standard report tablename is tblreport || userid;
It gets dropped at the beginning of the function, so it is basically a temp table that doesn't interfere with any other users.

Example:
    execute 'drop table if exists reports.tblreport' || v_userid ;
    execute 'drop sequence if exists reports.tblreport' || v_userid || '_id_seq; create sequence reports.tblreport' || v_userid || '_id_seq';
    v_sql=' create table reports.tblreport' || v_userid || ' as ';

Sim

 

В списке pgsql-general по дате отправления
От: Michael Paquier
Дата:
От: Krystian Bigaj
Дата:
FAQ