Re: Generate test data inserts - 1GB

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Generate test data inserts - 1GB
Дата
Msg-id 8515df43-2826-5e9b-60c8-daafe9294a9d@aklaver.com
обсуждение исходный текст
Ответ на Re: Generate test data inserts - 1GB  (Shital A <brightuser2019@gmail.com>)
Ответы Re: Generate test data inserts - 1GB  (Shital A <brightuser2019@gmail.com>)
Список pgsql-general
On 8/9/19 8:14 AM, Shital A wrote:
> 

> Hello,

> 
> 4) What techniques have you tried?
> Insert into with With statement, inserting 2000000 rows at a time. This 
> takes 40 mins.
> 

To add to my previous post. If you already have data in a Postgres 
database then you could do:

pg_dump -d db -t some_table -a -f test_data.sql

That will dump the data only for the table in COPY format. Then you 
could apply that to your test database(after TRUNCATE on table, assuming 
you want to start fresh):

psql -d test_db -f test_data.sql




-- 
Adrian Klaver
adrian.klaver@aklaver.com



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

Предыдущее
От: Rob Sargent
Дата:
Сообщение: Re: pg_wal fills up on big update query
Следующее
От: Shital A
Дата:
Сообщение: Re: Generate test data inserts - 1GB