New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
domain_admins table needs PRIMARY KEY #475
Comments
MySQL doesn't have any concept of PubSub etc :) (at least not that I've come across yet, I've not looked at 8.0 though). I don't think we can add a primary key on username there, as you might have e.g.
|
Ah, that's a good point, I didn't think of that issue. Having MySQL/MariaDB is a bit more complicated of a situation. It's a non-issue on MariaDB because they have enhancements to ROW based replication - but an INDEX is required. However, on MySQL and other variants, the absence of a PRIMARY KEY will cause ROW based replication to break. So the edit: Hmm, that's also an interesting quirk. On PgSQL, |
hm, all the datetime fields in PostfixAdmin are 'datetime' with no timezone specified. I think they're always set with the current date time from the server, and not exposed to end users (as such), so it'd normally be down to whatever time the server returns ? Perhaps this isn't ideal, but at least for me it does seem to use my current time :) (BST) |
Couldn't you just add an integer identity (auto increment) column? That would work fine as a primary key. |
I'm talking purely about the storage type in the schema. The default is always
Er, yes, you can. Because it uses 15:53:31.914473-04 will never appear twice, because of the way things operate internally when using The problem here is that MySQL and MariaDB A quick demonstration:
However, I definitely agree that a sequence is a better solution - especially since I missed that |
ah, yes.... a sequence is the obvious answer (and best)..... |
Yep... you can tell I hadn't had enough coffee. (Teach me to dredge up my old undocumented stuff, right? 🤦) The problem is, I can't find where the heck it's even creating
|
many changesets later .... postfixadmin/public/upgrade.php Line 2010 in af2cba2
|
…y column to domain_admins (id autoinc.) to help people who want to use db replication
I can confirm after applying @DavidGoodwin 's commits by hand, both PUBLICATION/SUBSCRIPTION and pglogical replication (including bidirectional) of the database is now functional out of the box. |
Try as I might, I can't seem to find the schema to send over a pull request. This is a pretty simple fix. In PostgreSQL, postfixadmin creates the domain_admins table thusly:
Consequently, PUBLICATION/SUBSCRIPTION and pglogical based replication will fail on the
domain_admins
table. Which is fine for a PUB/SUB scenario where subscribers don't have their own postfixadmin interface. It's not so great if you're looking to actually HA the database backing postfixadmin. (I'm sure MySQL/MariaDB has the same issue.)Fix is to change the
domain_admins
table to this:The text was updated successfully, but these errors were encountered: