yiisoft / rbac-db

yiisoft/db adapter for RBAC.
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
15 stars 7 forks source link

Change type `varchar(128)` to `varchar(126)` #45

Closed Tigrov closed 8 months ago

Tigrov commented 1 year ago

Tables are created with type varchar(128) https://github.com/yiisoft/rbac-db/blob/master/sql/pgsql-up.sql

In Postgres this type adds 4 bytes: The storage requirement for a short string (up to 126 bytes) is 1 byte plus the actual string... Longer strings have 4 bytes of overhead instead of 1. https://www.postgresql.org/docs/current/datatype-character.html

It makes sense to change the type to varchar(126)