You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The DatabaseCollation.supports? method only checks whether a named collation is available to the current database, it does not check whether it is compatible with the database encoding.
This is currently preventing us from using the it_IT locale as this does exist in the database but is only available for UTF8 encoding (our database uses SQL_ASCII). If we try to use the incompatible location after having checked its availability, we get an error back from Postgres which prevents PublicBody#list from rendering:
ERROR: collation "it_IT" for encoding "SQL_ASCII" does not exist
SHOW server_encoding; retrieves the database encoding SELECT pg_encoding_to_char(collencoding) FROM pg_collation where collname = 'it_IT'; gets a comparable encoding string for the named collation
(alternatively a collencoding of -1 is compatible with everything so that would also be fine - pg_encoding_to_char returns a blank string)
The
DatabaseCollation.supports?
method only checks whether a named collation is available to the current database, it does not check whether it is compatible with the database encoding.This is currently preventing us from using the it_IT locale as this does exist in the database but is only available for UTF8 encoding (our database uses SQL_ASCII). If we try to use the incompatible location after having checked its availability, we get an error back from Postgres which prevents
PublicBody#list
from rendering:(Background - the lookup on
pg_collation
is intended to be a multi-part key which includes the encoding - ref: https://www.postgresql.org/docs/9.2/static/catalog-pg-collation.html)Fixes mysociety/dirittodisapere-theme#106
The text was updated successfully, but these errors were encountered: