Using the .psqlrc configuration file to configure the OpenShift application psql shell
PostgreSQL provides a startup file called .psqrc
, which determines the behavior of the psql
interactive command-line client. Just like bashrc
, the psql client utility attempts to read and execute commands from the system-wide psqlrc file and the user's ~/.psqlrc
file before starting up. In this recipe, you will learn how you can use your own .psqlrc
configuration file to configure your OpenShift application psql shell.
Getting ready
To complete this recipe, you will need an application with the PostgreSQL cartridge. Please refer to the Adding the PostgreSQL cartridge to your application recipe in this chapter to learn how to install the PostgreSQL cartridge.
How to do it…
Perform the following steps to configure the psql shell:
Change the directory to
myapp
, and then SSH into the application gear:$ rhc ssh --app myapp
Create a new file in
$OPENSHIFT_DATA_DIR
named.psqlrc
:[myapp-osbook.rhcloud.com 531069cd5973cad58c0000b6...