Code: Select all
using (PgSqlConnection conn = new PgSqlConnection(Constants.ConnectionString))
{
conn.Open();
using (PgSqlDump pgSqlDump = new PgSqlDump { Connection = conn, Schema = "myschema", IncludeDrop = false, Mode = Devart.Common.DumpMode.Data })
{
pgSqlDump.Backup();
using (StreamWriter stream = new StreamWriter(file))
{
stream.WriteLine(pgSqlDump.DumpText);
stream.Close();
}
}
conn.Close();
}
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
SET default_tablespace = '';
SET default_with_oids = false;
Is PgSqlDump able to get data from Linux hosted database? Note, the code ran successfully before on Windows postgres database.