Creating read-only ODBC users for Contact Analyzer (Postgres >= 9.0)

Get into the psql command line

$ psql --dbname=ahadatamart --username=postgres
Password for user postgres:

ahadatamart=#

Create the role

-- Create generic role that will be applied to future users
-- Using CREATE ROLE instead of CREATE USER implies WITH NOLOGIN
CREATE ROLE _odbc;

-- Allow this role read-only access to our data
GRANT SELECT ON ALL TABLES IN SCHEMA public TO _odbc;

Create a user within the role

CREATE USER username IN ROLE _odbc WITH PASSWORD 'password'