Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

PostgreSQL Database auto connect script

Below steps help you to connect the postgresql database automatically without any password prompt
Step 1. create the bash_profile: and set the postgres environment variable
[root@2ndquadrant.in]# cat .bash_profile
export PGPASSWORD="nijam@345"
export PGHOST=""
export PGUSER="enterprisedb"
export PGPORT="5444"
/opt/edb/as9.6/bin/psql -d edb
Step 2. Run the .bash_profile  the this script directly will call the psql and connect the database without prompting any password
[root@2ndquadrant.in]# sh .bash_profile
psql.bin (
Type "help" for help.

edb=# \dt
            List of relations
 Schema |  Name   | Type  |    Owner
 public | dept    | table | enterprisedb
 public | emp     | table | enterprisedb
 public | jobhist | table | enterprisedb
 public | test    | table | enterprisedb
(4 rows)


Popular posts from this blog

How to find the server is whether standby (slave) or primary(master) in Postgresql replication ?

spfile and pfile errors

2017 Shortern URL - Other Website Like ADFOC.US

How to Get Table Size, Database Size, Indexes Size, schema Size, Tablespace Size, column Size in PostgreSQL Database

ORA-01261: Parameter db_recovery_file_dest destination string cannot be translated ORA-01262: Stat failed on a file destination directory Linux-x86_64 Error: 2: No such file or directory