Re: How to generate file from postgres data

Поиск
Список
Период
Сортировка
От Vijaykumar Jain
Тема Re: How to generate file from postgres data
Дата
Msg-id CAM+6J94y2NXiRC-zKbS8asTPcQ7CbDeJ_BtfpM_wS8V1m0D+TQ@mail.gmail.com
обсуждение исходный текст
Ответ на How to generate file from postgres data  (Shubham Mittal <mittalshubham30@gmail.com>)
Ответы Re: How to generate file from postgres data
Список pgsql-general

test=# create table t(id int, value text);
CREATE TABLE
test=# insert into t select x, x::text from generate_series(1, 1000) x;
INSERT 0 1000
test=#  COPY (select * from t where id < 50 order by id desc)  TO '/tmp/report.csv' DELIMITER ',' CSV HEADER;   ---- copy out the results via a view or sql directly
COPY 49
test=# \q
postgres@db:~/playground$ head -5 /tmp/report.csv
id,value
49,49
48,48
47,47
46,46

and send the csv tar zip compressed etc.

How does your client intend to load 1gb report in a viewer ? paginated ? all at once ?

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

Предыдущее
От: Shubham Mittal
Дата:
Сообщение: How to generate file from postgres data
Следующее
От: Vijaykumar Jain
Дата:
Сообщение: Re: How to generate file from postgres data