Message7926
Just FYI I have dusted off issue2550852 which adds first class support for
using PostgreSQL schemas to segment databases. I've updated the patch and
am working on getting the postgresql test suite working for it.
With this patch, specifying RDBMS_NAME = roundup.myschema will not create
the roundup database, instead init will delete/create the defined schema.
So if you are working in an environment where the DB is pre-created and the
roundup db user is granted create permissions on the db you should be all set.
The schema will be created and populated.
----
Getting this to work with a pg_service.conf file is still a work in progress
because there is no good way to discover the schema without parsing a string.
----
My thought is to change the logic for init when using MySQL or a schemaless PostgreSQL db
is to:
1) try to drop the db
2) if this fails with permission error (hopefully the db driver for MySQL and
other db's return a suitably narrow exception) or a database does not exist
error
3) try to create tables and load data
4) if create table or anything else fails, exit reporting that it must have an
empty database to start with.
Any other failure in step 2 raises the failure error.
I would like to keep the ability to create a database for 2 reasons:
1) Historically this has worked well when using a dedicated server for multiple
roundup db's. Create the user and everything else is SQLless.
2) There is a parallel between creating the database and creating the schema
in PostgreSQL. In neither case is the roundup db instance creation done using
SQL. Not having to use SQL to do things has been mentioned before as a win.
The documentation for creating users and setting grants/permissions is lacking for
both MySQL and PostgreSQL. They both discuss db native setup commands under running the
test suite. Nothing is said about commands to run for a production deployment.
Database directions to:
1) create a user
2) add/remove CREATEDB rights
3) (PG) grant the user the ability to create a schema in a db
4) (mysql) the grant to create/drop tables
should be linked to (or incorporated into) installation.txt. The existing installtion.txt
points to mysql.txt and postgres.txt so these are the likely places to put it.
Ivanov does this sound ok? |
|
Date |
User |
Action |
Args |
2023-12-27 18:48:11 | rouilj | set | messageid: <1703702891.6.0.324258242736.issue2551310@roundup.psfhosted.org> |
2023-12-27 18:48:11 | rouilj | set | recipients:
+ rouilj, ivanov |
2023-12-27 18:48:11 | rouilj | link | issue2551310 messages |
2023-12-27 18:48:11 | rouilj | create | |
|