PostgreSQL text can't hold a NUL byte, so a query that compares a column with a string containing one raises DataError and gives a 500: /layerindex/branch/master/recipes/?q=%00 /layerindex/api/recipes/?filter=pn:%00 /rrs/recipes/%00/6.2/M1/ DataError: PostgreSQL text fields cannot contain NUL (0x00) bytes MariaDB accepts these and returns no results. This needs fixing before the move to PostgreSQL (bug 16476): reject or strip NUL in search terms and path values before they reach the database (e.g. Django's ProhibitNullCharactersValidator on the search forms, or one middleware returning 400). Found by fuzz testing a bench instance running PostgreSQL 17.