Main reason I was hoping to not do that, is the value that would be stored in that column is dependent on what is stored in the attachment_bytes column, so to be 100% sure it's correct, you'd need that column controlled by a trigger, disallowing any explicit inserts or updates to the value. Was having a hard time finding info on this type of thing online though, so I was unsure if Postgres was working as intended, or if I had made a mistake somehow.
If you do know, what are the instances it is able to return data directly from an index instead of having to go to heap?