Thursday, 3 February 2022

PostgreSQL Basic Query1

-bash-4.1$ ./psql -p 5435 -U postgres -d postgres ---------------------
psql.bin (9.6.8)
Type "help" for help.

postgres=# show data_directory;
         data_directory          
---------------------------------
 /opt/PostgreSQL/9.6/bin/../data
(1 row)

postgres=# select current_user;
 current_user 
--------------
 postgres
(1 row)

postgres=# select version();
                                                 version                                                  
----------------------------------------------------------------------------------------------------------
 PostgreSQL 9.6.8 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16), 64-bit
(1 row)

postgres=# select datname from pg_database;
      datname       
--------------------
 postgres
 template1
 template0
 contrib_regression
 db96
(5 rows)

postgres=# select pg_backend_pid();
 pg_backend_pid 
----------------
          15013 



No comments:

Post a Comment

Master and Slave - Sync check - PostgreSQL

  1) Run the below Query on Primary:- SELECT     pid,     usename,     application_name,     client_addr,     state,     sync_state,     sen...