postgres
# Install postgres
sudo apt-get update
sudo apt-get -y install postgresql
sudo su - postgres
psql
for connection info : \conninfo
for password : \password
for roles : \du
for database : \l
for relation : \d
for table : \dt
postgres
# Install postgres
sudo apt-get update
sudo apt-get -y install postgresql
sudo su - postgres
psql
for connection info : \conninfo
for password : \password
for roles : \du
for database : \l
for relation : \d
for table : \dt
what is postgresql
PostgreSQL is a powerful, open source object-relational database system. It has more than 15 years of active development phase and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness.
This tutorial will give you a quick start with PostgreSQL and make you comfortable with PostgreSQL programming.
What is PostgreSQL?
PostgreSQL (pronounced as post-gress-Q-L) is an open source relational database management system (DBMS) developed by a worldwide team of volunteers. PostgreSQL is not controlled by any corporation or other private entity and the source code is available free of charge.
postgres
Fun fact: "Postgres" has exactly as many characters as "Database"
Check for yourself!
Postgres --> 8 chars!
Database --> 8 chars!
psql
In PostgreSQL the system determines which table is meant by following a search path, which is a list of schemas to look in.
The first matching table in the search path is taken to be the one wanted, otherwise, if there is no match a error is raised, even if matching table names exist in other schemas in the database.
To show the current search path you can use the following command:
SHOW search_path;
And to put the new schema in the path, you could use:
SET search_path TO myschema;
Or if you want multiple schemas:
SET search_path TO myschema, public;
Reference: https://www.postgresql.org/docs/current/static/ddl-schemas.html
psql commande \gset
=> SELECT 'hello' AS var1, 10 AS var2
-> \gset result_
=> \echo :result_var1 :result_var2
hello 10
psql commande \gset
=> SELECT 'hello' AS var1, 10 AS var2
-> \gset
=> \echo :var1 :var2
hello 10
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us