Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8055565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:25:48+00:00 2026-06-05T08:25:48+00:00

My requirements are as follows: Once the application starts the PostgreSQL service will be

  • 0

My requirements are as follows:

  1. Once the application starts the PostgreSQL service will be started by the application
  2. Once the application closes the PostgreSQL service will be closed by the application
  3. … so i will be taking care of the PostgreSQL setup and running the scripts and starting the service etc

How i am doing this at present is:

  1. when i start PostgreSQL in a new process i am redirecting the RedirectStandardError and RedirectStandardOutput, it is a silent start, user cannot see the command window etc

The problem is,

  • When I coded this I looked for message strings and only supported English. In other words, I used to look for the string success in RedirectStandardOutput but now we are supporting multiple languages so the comparison fails.

Is there any way i can find out whether PostgreSQL set up was successfully started and PostgreSQL service is running or not?

I am starting PostgreSQL by calling pg_ctl.exe in separate process.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T08:25:51+00:00Added an answer on June 5, 2026 at 8:25 am

    (we are doing something similar)
    you star the Postgres service by using this batch file

    "C:\Program Files\PostgreSQL\9.0\bin\pg_ctl.exe"  -D "C:\Program Files\PostgreSQL\9.0\data" start
    

    and for [Stopping] the service

    "C:\Program Files\PostgreSQL\9.0\bin\pg_ctl.exe"  -D "C:\Program Files\PostgreSQL\9.0\data" stop
    

    where C:\Program Files\PostgreSQL\9.0\bin\pg_ctl.exe is the location of your installation of PostgreSQl which u can get from

        HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\postgresql-9.0
    

    Now on running the Batch file to check if the service is indeed running you can use
    this code from Process running
    check for postgres.exe if its running or not.

    Also 1. checking-if-windows-application-is-running
    2. how-can-i-know-if-a-process-is-running

      public bool IsProcessOpen(string name)
        {
     //here we're going to get a list of all running processes on
     //the computer
     foreach (Process clsProcess in Process.GetProcesses()) {
        //now we're going to see if any of the running processes
        //match the currently running processes. Be sure to not
        //add the .exe to the name you provide, i.e: NOTEPAD,
        //not NOTEPAD.EXE or false is always returned even if
        //notepad is running.
        //Remember, if you have the process running more than once, 
        //say IE open 4 times the loop thr way it is now will close all 4,
        //if you want it to just close the first one it finds
        //then add a return; after the Kill
        if (clsProcess.ProcessName.Contains(name))
        {
            //if the process is found to be running then we
            //return a true
            return true;
        }
    }
    //otherwise we return a false
    return false;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The requirements for my application are as follows. I need to store orders which
Requirements Project should contain 1 main application and some secondary sub applications (which uses
Requirements: On a web page in our web application, we have a requirement to
The deployment requirements for my app (a windows service written in C#) state the
I am writing a HTML page and my requirements are as follows: HTML Page
I was asked to prototype two ETL frameworks. The requirements are as follows: Open
I want to typeset Mathematical problem-sets in Latex. My requirements are as follows: When
Requirements are as follows: Grouping hierarchies should be swappable, for example Country > City
The situation is as follows: I have an internal server running some WCF services,
My application does meet the requirements for using UIBackgroundModes set to 'App plays audio'.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.