Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: conditional backup in postgres

by sflitman (Hermit)
on Jul 16, 2010 at 08:53 UTC ( #849944=note: print w/replies, xml ) Need Help??

in reply to conditional backup in postgres

I work a lot in postgres and I find pg_dump to be a useful command, since I can call it in a cronjob.

I don't think it accepts the Where clause.

An alternative would be to run a command like this:

psql mydb -c "select * from C_order where period=2009 and org<>'A'"
And then you'll have output you could save. Look up the psql command's options, it will probably let you make the output more useful for your backup policy.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://849944]
[Corion]: marioroy: Heh, glad that you get enjoyment out of it! It's mainly a valve for me to vent some of the pressure ;-D
[Corion]: Oooh - note is interesting, at least in the sense that I will steal its command line interface for my own note taking app ;-D

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2017-08-16 14:06 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (265 votes). Check out past polls.