Don't know if this is the official way to request an enhancement, but anyway…

I see that between 1.x and 2.x the database table names were prefixed with dbmail_, presumably for namespace safety. It would be nice if there were a way to get dbmail to optionally use SQL schemas (supported by PostgreSQL (7.3+, and MySQL (5.0.2+)) to formally segregate the dbmail tables. This way users could (namespace-safely) include dbmail data and other data in the same database (and relate other data to dbmail data).

The schema name could be specified in dbmail.conf, [DBMAIL] section, either as a new variable (schema=…) or by appending it to db, e.g. db=my_database.my_mail_schema.

To make dbmail use the schema, db_connect() could issue a SET search_path TO my_mail_schema, or the table names could be prefixed by the schema name for all database queries (e.g. SELECT curmail_size FROM my_mail_schema.dbmail_users). The former method would seem to be the easiest, and perhaps safest.

Apr. 6 '05: The patch mentioned here: would suffice for this.

Oct. 10 '06: I think it is not a good idea to use schemas instead of table-prefixes, according to the MySQL-documentation a schema is only an alias for a database so you require to create a new database for the dbmail-tables in the idea of having dbmail-tables and other tables in the same database separated by a schema does not apply to mysql. See here: MySQL reference doc – Dennis

Feb. 25 '07: Proposed compromise: a table_prefix that can contain a dot for schema qualification (table_prefix=“schema.”)

sql_schemas.txt · Last modified: 2012/02/27 21:40 by bas
DBMail is developed by Paul J Stevens together with developers world-wide