1
Is there any way to insert a UUID
automatically in a table field, in the same way as with a field of the type AUTO_INCREMENT
?
In a framework for PHP, Cakephp, when defining the primary key as VARCHAR(40)
, he inserts a UUID
automatically, as if it were auto table increment.
Is there a way to do this directly from Mysql? Or do we always have to set UUID at the time of INSERT
?
Example:
Usuarios
- uuid
- nome
- senha
You need to improve something to accept?
– Maniero
@bigown, I was told that on shared servers, this
TRIGGER
is blocked. Does it proceed? That’s why I hadn’t marked :\– Wallace Maxters
As far as I know it is not no, and if it is case by case. I see no reason to be blocked and from my experience, never seen to be. And it’s not so easy to block this, would have to tamper with the Pgsql code.
– Maniero