I used 3rd method creating pgpass.conf file in case I wanna connect to several servers without writing passwd each time.
This is code(maybe it can be useful):
String user = Environment.UserName;
String user1 =...
I executed line command.
Only errors.txt is filled and it contains all informations that I need:
pg_dump: last built-in OID is 16383
pg_dump: reading extensions
pg_dump: identifying extension members
pg_dump: reading schemas
pg_dump: reading user-defined tables
pg_dump: reading user-defined...
without cmd.exe inside arguments pg_dump isn't executed and in richTextBox following messages are shown:
Microsoft Windows [Versione 10.0.19043.1348]
(c) Microsoft Corporation
As well as using :
info.FileName = @"C:\Backup_PostgreSQL\pg_dump.exe";
and as arguments:
I created a form in order to backup my postgres DB.
I'm using pg_dump.exe and executing it as process and setting CreateNoWindow = false and UseShellExecute = true in processStartInfo I can see opening DOS shell, I can see all single messages of pg_dump and Backup is successfully...