How to insert string with super script characters in PostgreSQL?
I want to insert "TM" as power of string "RACH"? I tried the following query:
update contact SET name=E'RACH$^'TM where id='10782'
How to insert string with super script characters in PostgreSQL?
I want to insert "TM" as power of string "RACH"? I tried the following query:
update contact SET name=E'RACH$^'TM where id='10782'
I don't know if it possible to convert symbols to supersripts without creating mapping function for that, but you can just write it manually:
update contact SET name='RACHᵀᴹ' where id='10782'
Mapping function could be something like this:
create or replace function superscript(data text)
returns text
as
$$
declare
ss text[];
lt text[];
begin
ss := '{ᴬ,ᴮ,ᴰ,ᴱ,ᴳ,ᴴ,ᴵ,ᴶ,ᴷ,ᴸ,ᴹ,ᴺ,ᴼ,ᴾ,ᴿ,ᵀ,ᵁ}';
lt := '{A,B,D,E,G,H,I,J,K,L,M,N,O,P,R,T,U}';
for i in 1..array_length(ss, 1)
loop
data := replace(data, lt[i], ss[i]);
end loop;
return data;
end;
$$
language plpgsql;
In text editor like Word or LibreOffice Writer:
Use the dedicated characters '®' or '™' as trademark signs.
Some other characters (but not all!) have superscript variants in Unicode, but many fonts don't support these exotic code points and don't even include glyphs to represent them. Except for the common '¹ ² ³', I would rather use formatting to achieve a superscript effect.
Here on SO, you could use: demo superscript ABC
That's the output of
<sup>demo superscript ABC</sup>
More info on the Wikipedia page on superscript characters.
If you need a mapping function use
translate()
.would be very inefficient.replace()
in a loop