The Manual

Copy/Duplicate an entire Postgres database on the same server.

Stolen from TablePlus Blog [https://tableplus.com/blog/2018/04/mysql-get-size-of-tables.html], Cool product check it out here [https://tableplus.com/]! First, lets check to see if the database has active connections.. SELECT pid,usename,client_addr,wait_event_type,wait_event,state,query,backend_type FROM pg_stat_activity

Create a read-only role & user in PostgreSQL

Create the role for exampledb.... Note, make sure to connect to the db you want to effect privileges for... \c exampledb; CREATE ROLE exampledb_read_only_role; GRANT USAGE ON SCHEMA public TO exampledb_read_only_role; GRANT SELECT ON ALL TABLES IN SCHEMA public TO exampledb_read_only_role;

The Manual © 2026