Tikejhya: Ashish Nepal

Knowledgebase

Category: postgresql

‘show full processlist’ in postgres?

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

SELECT * from pg_stat_activity;

postgresql grant all

Your ads will be inserted here by

Easy Plugin for AdSense.

Please go to the plugin admin page to
Paste your ad code OR
Suppress this ad slot.

GRANT ALL PRIVILEGES ON SCHEMA schema_name TO user;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA schema_name TO user;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA schema_name TO user;

# Alter user
alter user tikejhya with password ‘new_pass’;

# Grant superuser
ALTER USER tikejhya WITH SUPERUSER;

pg_hba.conf
Allow login remotely using md5:
host all all 0.0.0.0/0 md5

POSTGRES READ ONLY USER:

create user user;
alter user backup_user with encrypted password 'somepassword';
GRANT SELECT ON ALL TABLES IN SCHEMA public TO user;

GRANT CONNECT ON DATABASE mydatabase to user;
\c mydatabase
GRANT USAGE ON SCHEMA public to backup_user;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO lportal;
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO backup_user;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO backup_user;
GRANT USAGE ON SCHEMA public to backup_user;

Powered by WordPress & Theme by Anders Norén