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 8090087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:36:10+00:00 2026-06-05T19:36:10+00:00

During the installation of my app, I want to create a PostgreSQL-Database and some

  • 0

During the installation of my app, I want to create a PostgreSQL-Database and some tables and functions.

For that purpose I use PSQL.EXE that ships with PostgreSQL. I have 2 scripts. The first one creates the database and a corresponding user that has rights to execute scripts on that database. I want to execute the second script as this just created user. Unfortunately I can’t find a way to pass the password for that user as a command line argument. Omitting the password leads to a stop of execution and a prompt for the user to enter the password, which I would like to avoid – since this is executed during installtion of my app.

Is there any way to pass the password as argument or is there any other command line tool I could use?

To explain the environment a bit further. I use WiX 3.5 setup as a “MSI-Builder”.

  • 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-05T19:36:12+00:00Added an answer on June 5, 2026 at 7:36 pm

    You can either use a pgpass file as dbenhur answerd, or you can set the environment variable PGPASSWORD before calling psql:

    SET PGPASSWORD=my_very_secret_password
    psql somedb someuser
    

    All supported environment variables are documented in the manual: http://www.postgresql.org/docs/current/static/libpq-envars.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create some empty folder in COMMONAPPDATAFOLDER during installation but it
I have an application that changes some registry values during installation. I am changing
Is the option to create a desktop shortcut during installation only available if the
My installer requires admin privileges. During installation some values are written to the HKCU
I'm building an installer using InstallScript MSI project. During installation I save some information
Those are asked during the installation, but are not anywhere in config files\tables to
During an interview I was asked if there can be some object that will
During the debugging of my WP7 app I want to access photo gallery, which
During an app update via the App Store I want to update the SQLite
Is there some restrictions of access to store configuration during installation of custom module

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.