Re: pg_dump with select output

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Adarsh Sharma <adarsh(dot)sharma(at)orkash(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump with select output
Date: 2011-02-16 10:02:26
Message-ID: 4D5BA0B2.7070805@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 16/02/2011 09:54, Adarsh Sharma wrote:
> Dear all,
>
> I am using pg_dump in Postgresql database very often and read several
> parameters of it.
> But today i want to back up that part of table which satisfies satisfies
> certain condition ( select command ).
>
> In mysql , this is achieved as below :
>
> mysqldump -h192.168.1.106 -uroot -porkash -q -w"internalurl_id between 1
> and 30" bicrawler internalurl > /root/Desktop/internal_url.sql
>
> -w option is used for executing select command .
>
> But don't know how this is achieved through pg_dump command.

You can't do this in pg_dump. pg_dump can backup:

- the entire database
- a schema, using -s
- a table, using -t

...but not a subset of rows from a table. Maybe you want the COPY command?

http://www.postgresql.org/docs/9.0/static/sql-copy.html

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sim Zacks 2011-02-16 13:26:35 Re: pg_dump with select output
Previous Message Adarsh Sharma 2011-02-16 09:54:45 pg_dump with select output