Compare commits

...

2 Commits

Author SHA1 Message Date
barnold 2f4c33071f Fix a typo. 2022-10-16 18:26:33 +01:00
barnold 2593fc17b5 Update INSTALL. 2022-10-16 09:32:06 +01:00
1 changed files with 18 additions and 19 deletions

37
INSTALL
View File

@ -23,19 +23,23 @@ These are one-time things to do, in that you can recreate and reload
the catalog database any number of times without having to do these the catalog database any number of times without having to do these
steps again. steps again.
Create a user to own the tables and a role to use the tables. (The Create roles to own and manage the tables. (The connection limits are
connection limits are merely suggestions.) merely suggestions.)
# su - postgres ## The table owner, must be 'pgc_owner'
$ createuser --connection-limit=1 --createdb --echo pgc_owner $ createuser --connection-limit=1 --createdb --echo pgc_owner
## The table user role, must be 'pgc_user'
$ createuser --connection-limit=5 --no-login pgc_user $ createuser --connection-limit=5 --no-login pgc_user
## A user who will connect as pgc_owner, named as you like,
## e.g. your own username.
$ createuser --connection-limit=1 irulan
Configure postgres to allow connection to the catalog database by your Configure postgres to allow "irulan" to connect to the catalog
postgres username, e.g. "irulan". This is for the case that the database as pgc_owner, so that irulan can manage the database. This
postgres server runs on the same host. Consult postgres's excellent is for the case that the postgres server runs on the same host.
documentation for other cases. Consult postgres's excellent documentation for other cases.
In pg_ident.conf, add two map lines so that the end of the file resembles this: In pg_ident.conf, add map lines so that the end of the file resembles this:
# MAPNAME SYSTEM-USERNAME PG-USERNAME # MAPNAME SYSTEM-USERNAME PG-USERNAME
irulanmap irulan irulan irulanmap irulan irulan
@ -48,20 +52,15 @@ In pg_hba.conf, modify the second "local" line, the one following the
Tell postgres about these edits. Tell postgres about these edits.
# systemctl reload postgres # systemctl reload postgresql
At this point "irulan" has privilege to create and drop the catalog At this point "irulan" has privilege to create and drop the catalog
database. Routine use of the database is more safely done by a database. Routine use of the database is more safely done by a
username with lesser privilege, i.e. only the "pgc_user" role. E.g. username with lesser privilege, i.e. only pgc_user. See pgc-www's
as postgres, run INSTALL for an example (<https://tildegit.org/barnold/pgc-www>).
$ psql
postgres=# grant pgc_user to fenring;
postgres=# \q
2. As the operating system user "irulan", you should now be able to 2. As the operating system user "irulan", you should now be able to
use any of the targets in Makefile.orig to create and load the catalog create and load the catalog database.
database.
$ make PGC_DANGEROUS=1 rebuild-db $ make PGC_DANGEROUS=1 rebuild-db
$ make load-catalog $ make load-catalog
@ -75,7 +74,8 @@ with e.g.
sudo make install-modules sudo make install-modules
which installs under /usr/local/lib/site_perl. Alternatively do e.g. which installs them under /usr/local/lib/site_perl. Alternatively do
e.g.
make PGC_PERL5LIB=~/.local/lib/perl5 install-modules make PGC_PERL5LIB=~/.local/lib/perl5 install-modules
@ -83,4 +83,3 @@ though you'll probably need to set PER5LIB in this case before using
the modules in your perl code. the modules in your perl code.
Comments and questions welcome at <barnold@tilde.club>. Comments and questions welcome at <barnold@tilde.club>.