Click here to Skip to main content
Click here to Skip to main content
 
Add your own
alternative version

Tagged as

Backup/Restore PostgreSQL databases

, 5 Mar 2013
Allow your applications the ability to backup and restore your PostgreSQL databases.
pgstore-noexe.zip
pgstore
Properties
pgstore.zip
bin
Debug
pgstore.dll
Release
lib
libeay32.dll
libiconv-2.dll
libintl-8.dll
libpq.dll
Npgsql.dll
pg_dump.exe
pg_restore.exe
ssleay32.dll
zlib1.dll
obj
Debug
TempPE
StoreApp-noexe.zip
StoreApp
bin
Debug
Properties
Settings.settings
Resources
backup-review.png
StoreApp.zip
pgstore.dll
StoreApp.exe
StoreApp.vshost.exe
Release
obj
Debug
TempPE
x86
Debug
TempPE
Settings.settings
backup-review.png
pgstore.dll
libeay32.dll
libiconv-2.dll
libintl-8.dll
libpq.dll
Npgsql.dll
pg_dump.exe
pg_restore.exe
ssleay32.dll
zlib1.dll
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace pgstore
{
    /// <summary>
    /// This class is used to indicate parameters used to launch pg_dump aund pg_restore commnds
    /// the parameters are initialized with the most common parameters
    /// its could be changed if necessary to do a specific tasks
    /// </summary>
    public class StoreParameters
    {
        public StoreParameters()
        {
            DataOnly = false;
            Blobs = true;
            Clean = false;      
            Oids = false;
            NoOwner = false;
            SchemaOnly = false;
            NoPrivileges = false;
    
        }
        public bool DataOnly { get; set; }
        public bool Blobs { get; set; }
        public bool Clean { get; set; }    
        public bool Oids { get; set; }
        public bool NoOwner { get; set; }
        public bool SchemaOnly { get; set; }
        public bool NoPrivileges { get; set; }
 

        public string DataOnlyCode { get { if (DataOnly)  return " -a"; return ""; } }
        public string BlobsCode { get { if (Blobs) return " -b"; return ""; } }
        public string CleanCode { get { if (Clean && !DataOnly)   return " -c"; return ""; } } 
        public string OidsCode { get { if (Oids) return " -o"; return ""; } }
        public string NoOwnerCode { get { if (NoOwner) return " -O"; return ""; } }
        public string SchemaOnlyCode { get { if (SchemaOnly) return " -s"; return ""; } }
        public string NoPrivilegesCode { get { if (NoPrivileges) return " -x"; return ""; } }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Saddoud Anis
Software Developer (Senior) B&B
Tunisia Tunisia
Microsoft DOTNET developer
VOIP Technologies
ERP Petales
 
http://www.declaration.tn/

| Advertise | Privacy | Mobile
Web03 | 2.8.140827.1 | Last Updated 5 Mar 2013
Article Copyright 2013 by Saddoud Anis
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid