Posts

Showing posts from June, 2019

version in PostgreSQL

postgres=# select version(); version ------------------------------------------------------------------------------------------------------------------------ ----------  PostgreSQL 11.3 (Debian 11.3-1.pgdg90+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 6.3.0-18+deb9u1) 6.3.0 2017051 6, 64-bit (1 row)

Oracle Alter session like in postgres

If you are looking for looking for alter session set curent_schema=ABCD;  kind of statement in postgres we have  Example : dvdrental=# create user test password 'test'; CREATE ROLE                         If you want to inherit permissions of another role you can do : dvdrental=# alter role test  CREATEROLE CREATEDB; ALTER ROLE dvdrental=# SELECT SESSION_USER, CURRENT_USER;  session_user | current_user --------------+--------------  postgres     | postgres (1 row) If you want to change user to another user without reconnecting (like sudo in Linux) : dvdrental=# SET SESSION AUTHORIZATION 'test'; SET dvdrental=> SELECT SESSION_USER, CURRENT_USER;  session_user | current_user --------------+--------------  test         | test (1 row) dvdrental=>