Project

General

Profile

« Previous | Next » 

Revision 6822

Makefile mk_db, schemas/pg_hba*.conf: Added passwordless public_ user with access to just the database schema. Note that in PostgreSQL, only users with explicit GRANT permissions on a table can read data in that table, but all DB users with a login can view all table schemas.

View differences:

schemas/pg_hba.Mac.conf
97 97
#host    replication     postgres        127.0.0.1/32            trust
98 98
#host    replication     postgres        ::1/128                 trust
99 99

  
100
local   template1,vegbien  public_           trust
101
host    template1,vegbien  public_ 0.0.0.0/0 trust   
102
host    template1,vegbien  public_ ::/0      trust
103

  
100 104
local   template1,vegbien  +bien            ident
101 105
local   template1,vegbien  +bien            md5
102 106
host    template1,vegbien  +bien  0.0.0.0/0 md5   
schemas/pg_hba.conf
91 91

  
92 92
#host    all         all         0.0.0.0/0             md5
93 93

  
94
local   template1,vegbien  public_           trust
95
host    template1,vegbien  public_ 0.0.0.0/0 trust   
96
host    template1,vegbien  public_ ::/0      trust
97

  
94 98
local   template1,vegbien  +bien            ident
95 99
local   template1,vegbien  +bien            md5
96 100
host    template1,vegbien  +bien  0.0.0.0/0 md5   
Makefile
248 248
db: mk_db rm_initial_public _always ;
249 249

  
250 250
mk_db: _always
251
	-echo "CREATE USER public_;"|$(psqlAsAdmin)
251 252
	-echo "CREATE USER bien PASSWORD '$(bienPassword)';"|$(psqlAsAdmin)
252 253
	-echo "CREATE USER bien_read PASSWORD '$(bienReadPassword)' IN ROLE bien \
253 254
NOINHERIT;"|$(psqlAsAdmin)
......
267 268
	echo "DROP DATABASE IF EXISTS vegbien;"|$(psqlAsAdmin)
268 269
	echo "DROP USER IF EXISTS bien_read;"|$(psqlAsAdmin)
269 270
	echo "DROP USER IF EXISTS bien;"|$(psqlAsAdmin)
271
	echo "DROP USER IF EXISTS public_;"|$(psqlAsAdmin)
270 272

  
271 273
reinstall_db: _always rm_db db ;
272 274

  

Also available in: Unified diff