What is the best Postgres datatype to use for a primary key that holds values of fixed size strings?
(for instance - values are exactly 6 chars of the alphabet [0-z,a-z,A-Z]).
Should I use char[6] (is it even appropriate to use as a primary key?) Should I use bigserial and do convertion from number to base62 in the application?
checkconstraint.textis the "best" for anychar, varying or fixed lengthVarChar(6)in Postgres is pretty much the same astextwith a check constraint on the length, whileChar(6)actually has to do extra work for certain cases to do with space padding.