I'm not familar with postgreSQL database, but I am currently working with MySQL and have found the book: "Programming the Perl DBI" by Alligator Descartes and Tim Bunce to be quite helpful. The Perl DBI is fantastic and is easier to use than similar things in other languages.

What you are describing is not what I would call "backup". It sounds like you want to export and then remove that data from the main data base, with the option to re-import that data later. Basically, "prune" some old stuff out that isn't relevant anymore, but keep an archive copy so that it could be accessed later if the need arises.

Knowing Perl and how to use the Perl DBI isn't going to help you if you don't have a firm grasp of the postgreSQL tools available for this task. A serious point to consider is the format of the data for this "archived" copy. I mean if you need it 5 years from now, is it "going to work"?.

I did look on the web re: postgreSWL and they appear to have a lot of utilities for this sort of thing. "Pruning" out some data is a common task. It could very well be that Perl is not the main thrust of what you need to do/learn about. I would look seriously at the postgreSQL tools first.

So: Can you do this "manually" without Perl? What part of the problem do you think that Perl will help solve?


In reply to Re: conditional backup in postgres by Marshall
in thread conditional backup in postgres by suhailck

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.