psql puppetdb -c 'grant puppetdb_read to puppetdb'
The createdb command should precede the psql command:
sudo -u postgres sh
createuser -DRSP puppetdb
createuser -DRSP puppetdb_read
# For coordinating partition cleanup
psql puppetdb -c 'grant puppetdb_read to puppetdb'
createdb -E UTF8 -O postgres puppetdb
psql puppetdb -c 'revoke create on schema public from public'
psql puppetdb -c 'grant create on schema public to puppetdb'
psql puppetdb -c 'alter default privileges for user puppetdb in schema public grant select on tables to puppetdb_read'
psql puppetdb -c 'alter default privileges for user puppetdb in schema public grant usage on sequences to puppetdb_read'
psql puppetdb -c 'alter default privileges for user puppetdb in schema public grant execute on functions to puppetdb_read'
In PuppetDB setup for Postgresql, the database, 'puppetdb' doesn't yet exist when issuing the command:
psql puppetdb -c 'grant puppetdb_read to puppetdb'
The createdb command should precede the psql command: