E
E
Evgeny Ilin2012-07-22 07:21:56
linux
Evgeny Ilin, 2012-07-22 07:21:56

How to make a limited (selective) dump in Postgres?

For example:
mysqldump -uUSER -pPASS --database DATABASENAME -w '1 limit 100' >FILENAME.sql

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
niko83, 2012-07-22
@geirby

I found this solution on the Internet (didn't check it myself):
psql -h … -c 'copy (select… from where ...)
to stdout' | psql -h ... -c 'copy from stdin'
taken from archives.postgresql.org/pgsql-general/2011-09/msg00277.php

M
marklarius, 2012-07-22
@marklarius

Create a temporary table and dump only it through -t.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question