0

Hopefully a simple question. If I Install PostgreSQL x64 Version 15 like this

            Process process = new()
            {
                StartInfo = new ProcessStartInfo
                {
                    FileName = exePath,
                    Arguments = $"--datadir \"{dataInstallPath}\" --servicename PostgreSQL.{version}.Service --serverport {port} --prefix \"{versionPath}\" --mode unattended",
                    UseShellExecute = false,
                    CreateNoWindow = true,
                }
            };

It installs it on the path, I provided (Example D:\PostgreSQL)

If I want to install a second instance of it with the same Command but another path (C:\PostgreSQL), it tries to install it on the old path (D:\PostgreSQL) because it gets the old path from the Registry HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL

Is there any way to prevent this so i can install multiple PostgreSQL instances?

The background is as follows. We need the database on a customer server and it may be that a customer database already exists in which we do not want to work.

2
  • I would use containers instead. Why would you install at the OS level nowadays? Commented Apr 13, 2024 at 23:38
  • This is the company's specification, I have absolutely no influence on it. Commented Apr 15, 2024 at 5:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.