Sunday, 27 September 2020

Postgresql: Important Queries

 --To get the list of tables in Postresql:

SELECT * FROM information_schema.tables WHERE table_name = 'tablename'


--To get the list of columns in the Postgresql tables:

SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'tablename';

Data Sharing

  1. Create Share CREATE SHARE my_share; 2. Grant privileges to share GRANT USAGE ON DATABASE my_db TO SHARE my_share; GRANT USAGE ...