How to change psql default listening host?

2,211

How about an alias for psql?

alias psql="psql --host localhost"

Alternatively you could set the PGHOST environment variable.

Share:
2,211
rowanphilip
Author by

rowanphilip

Updated on September 17, 2022

Comments

  • rowanphilip
    rowanphilip over 1 year

    My program has to search through a CSV file line by line and if a unique item is found, another form needs to be opened asking the user for more information on this item to store in a file before continuing to search the CSV file. I have browsed around looking for an answer and the only thing that I can find is showmodal which closes the pop-up form after it's finished. I need to keep the form open in case there is another unique item. I have also tried having a repeat, until loop which repeats until the value of a certain variable is changed by the pop-up form, allowing the program to continue when the pop-up form is hidden. This, however, does not seem to work and causes the pop-up form to be blank and unusable. Help please!

    • David Heffernan
      David Heffernan over 10 years
      Put the long running code in a thread.
    • Andy_D
      Andy_D over 10 years
      Is the user's input critical to continuing the processing and is future processing dependent upon previous user input?
  • shahjapan
    shahjapan over 13 years
    It may work but its not concrete solution, I want to know something solid like what's default value of --host and from which config. file I can alter the host name.
  • Joril
    Joril over 13 years
    Psql does read ~/.psqlrc on startup, but it looks like you can only use it to configure the connection, not the login itself...
  • Joril
    Joril over 13 years
    There's PGHOST too.. Modified the answer
  • rowanphilip
    rowanphilip over 10 years
    The "Modal" itself Actually stores the item(s) in the file and is a fairly complex form. It can't just be a message dialog. How do I use the modal method but be able to use this form again?
  • Arioch 'The
    Arioch 'The over 10 years
    do not free/dispose/release the form after ShowModal, then you can change all the properties you need to change and ShowModal again
  • Arioch 'The
    Arioch 'The over 10 years
    also if the form has OnClose event ensure it chooses "hide" action instead of destroying itself