Where clause in pg_dump: need help

From: Prashanth Adiyodi <Prashantha(at)celltick(dot)com>
To: "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Where clause in pg_dump: need help
Date: 2016-07-07 14:06:29
Message-ID: B54BB2A19D2CA541BABFBFAC6B9C33DCA5D779@Cobra.celltick.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

Dear Team,

I am working on a script where I need to take backup of certain tables (or a database) using the "date_trunc('day', NOW() - interval '1 month');" as a where clause. I have read online that this is achievable with the "t" option and I have tried the below command

pg_dump --table=re_userstatus --data-only --column-inserts -t "date_trunc('day', NOW() - interval '1 month')" comp_db > data1.sql

but this does not work, could you please help with the correct syntax or redirect me to any documentation which implements this, I am a newbee to Postgres SQL and I need this help from you, my pg_dump version is

pg_dump (PostgreSQL) 9.3.4

Many Thanks

Prashanth Adiyodi
Technical Account Manager
Skype: prashanth.adiyodi
Mob: +91-9819488395
[celltick]

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message ssatyasrinivas 2016-07-07 15:01:37 BUG #14233: getting the size if the database failing with permission denied error
Previous Message Michael Paquier 2016-07-07 06:38:26 Re: BUG #14230: Wrong timeline returned by pg_stop_backup on a standby

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2016-07-07 15:08:43 Re: Where clause in pg_dump: need help
Previous Message Thomas Kellerer 2016-07-07 13:15:13 Re: Best way to insert a row with two columns having the value based on the same argument generated by another postgres function.