Extensions in Postgresql
-> Its helpful to collect all objects into a single package is called extension. Eg: If a new data type will require new functions,new operators and new index operator classes…
-> Its helpful to collect all objects into a single package is called extension. Eg: If a new data type will require new functions,new operators and new index operator classes…
Version of PostgreSQL: cmd:select version(); Creating the user in the shell prompt: cmd:create user postgres_user; Creating the database in the shell prompt: cmd: /usr/local/pgsql/bin/createdb my_db -O postgres -p 5435; ->…
-> After the installation of postgresql we need to create the user account for the postgresql. -> For this login as root and then execute the cmd below. cmd:adduser postgres…
-> To get the active sessions use this query. cmd:select usename, pid, datname from pg_stat_activity; -> Now we can see the active sessions if we want to close all the…
-> To restore the custom dump then we should always use pg_restore Syntax:instllation_location -Fc -d db_name port location_of_dump_file cmd: /usr/local/pgsql/bin/pg_restore -Fc -d sandbox_db -p 5435 /DB/sandbox_db_21_nov_17_custom -> To restore the…
To take the custom dump: Syntax: pgsql installation_directory type_of_dump database_name port location_of_file then use this cmd and then enter password for the user. cmd: /usr/local/pgsql/bin/pg_dump -Fc -d sandbox_db_nims -p 5435…
-> After the set up is completed i.e. both installation and initdb the database is accessable from the local host alone. If we want to access the server from other…
-> To create the databse go to installation directory of postgres and create the database as follows. cmd:/usr/local/pgsql/bin/createdb test1 -p 5432 -> To conncet to the database use the cmd…
-> After the initilizing the data directory we need to start the server. Default port is 5432. To start the server: Go to the installation directory then give the data…
-> Login as root or any user. syntax:scp source_path destination_path cmd: scp postgres@10.16.16.59:/DB/installation_files/postgresql-9.5.8.tar.gz /opt/ -> Then it will prompt for the password of the destination system user then the file…