-
Notifications
You must be signed in to change notification settings - Fork 439
[dbal] DBAL transport no longer works on PostgreSQL as of 0.9.0 #670
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
Comments
It's time to add postgreSQL to our test stack. |
We used v1 but there were collisions (I still wonder why?) and there are no ones with v4 so we left it.
This is something I expect Doctrine should handle, isn't it? |
I believe the ramsey/uuid-doctrine package may be able to handle it: https://github.com/ramsey/uuid-doctrine#binary-database-columns |
It seems highly improbably to have a collision on a UUID v1 so it must have been something else causing them. Quoted from Stack Overflow:
|
Default time generator in ramsey library uses gettimeofday function. This function is not high performance timer. It can only get microseconds. So collisions may occurs. And you can not use binary encoded UUIDs in doctrine's UUID type. (because it is db abstraction layer) In MairaDB I've got an error too. Because uuid mapped to char type, and DB expects valid unicode sequence. |
@Nommyde that makes sense. In that case, it is better to stick to V4 UUIDs. According to this comment in #280, it seems like there is not much of a real-world performance gain from using binary UUIDs. It is probably better to switch back to strings, which have better cross-platform compatibility. If the highest performance is desired, choose one of the AMQP transports instead. |
What should be done:
|
Is there someone willing to take it? |
I've had an issue with the binary formatted id's and using a minor tweaked fork for now. I'm just using the string rep of the uuid. It used to be like this, no? |
@jverdeyen yeap, it should be the way you've done it. |
Ok, I'll clean it up and create a PR for this change. |
fixed in 0.9.5 |
There is an issue of PostgreSQL not being able to work with UUID byte sequences produced by ramsey/uuid (see ramsey/uuid#179 for more details). The UUID type in PostgreSQL only accepts UUIDs in the hex string format (see https://www.postgresql.org/docs/current/datatype-uuid.html).
Additionally, according to this comment, OrderedTimeCodec only works with UUIDv1 and you are using UUIDv4 which is random, so I do not think that the codec is actually doing anything useful here.
Temporary solution:
I made a hotfix which switches binary back to hex string in case anybody needs to get PostgreSQL working while this issue is being examined.
The text was updated successfully, but these errors were encountered: