postgres simple number to string mapping
IMHO the easiest way is by using a lookup table.

create table lk (id int, name text);

insert into lk values
(1, 'apple'),(2, 'google'),(3, 'msft'),(4, 'amazon');

create table t (id serial, lk int);
insert into t (lk) values (2),(1),(3),(4);

select
    t.id,
    lk.name
from   t
join   lk
       on lk.id = t.lk;




id | name  
-: | :-----
 2 | apple 
 1 | google
 3 | msft  
 4 | amazon



db&lt;>fiddle here