Different behavior when using collation: SELECT * vs SELECT column

I’m not sure if this is a bug – it’s far more likely it’s a misunderstanding on my part. I have a table with a collated column (for a case-insensitive unique constraint):

  table_name |                     create_statement
  accounts   | CREATE TABLE accounts (
             |     uuid UUID NOT NULL,
             |     created TIMESTAMP NOT NULL DEFAULT now():::TIMESTAMP,
             |     username VARCHAR(30) COLLATE en_u_ks_level2 NOT NULL,
             |     CONSTRAINT "primary" PRIMARY KEY (uuid ASC),
             |     UNIQUE INDEX accounts_username_key (username ASC),
             |     FAMILY "primary" (uuid, created, username)
             | )

When I select username specifically, I get an encoded string, but if I use select * I get a human readable value. Curiously, I also get that human readable value if use select username, *:

> select username from accounts where username = 'admin1' collate en_u_ks_level2;
  \x15\xef\x161\x17A\x16\xcd\x17O\x14\xe7\x00\x00\x00 \x00 \x00 \x00 \x00 \x00
(1 row)
> select * from accounts where username = 'admin1' collate en_u_ks_level2;
                  uuid                 |             created             | username
  2686c575-b3be-4fe2-8417-fe020e8c02ca | 2020-04-26 00:42:37.56298+00:00 | admin1
(1 row)
> select username, * from accounts where username = 'admin1' collate en_u_ks_level2;
  username |                 uuid                 |             created             | username
  admin1   | 00000000-0000-0000-0000-000000000001 | 2020-04-26 00:42:37.56298+00:00 | admin1
(1 row)

Is select * applying some sort of implied translation? If so, is there a way for me to make that explicit?

I am running cockroachdb v20.

Interesting. I’m not sure what causes this. It does seem like a bug, but I can’t reproduce it.

Actually, it might be caused by https://github.com/cockroachdb/cockroach/issues/47115, which was fixed on our development head. We’ll backport the fix for that, so that it should be fixed in the next release of 20.1.