I am trying to replicate an Oracle check constraint that prevents non-printing characters in postgres, and I am stumped. I think postgres may be treating :print: and :ascii: as synonymys?!?
select REGEXP_REPLACE('bla', '[^[:print:]]', '[X]','g') ;
regexp_replace
----------------
bla
(1 row)
select REGEXP_REPLACE('bla'||chr(10)||'bla', '[^[:print:]]', '[X]','g') ;
regexp_replace
----------------
bla[X]bla
(1 row)
select REGEXP_REPLACE('Ҕ', '[^[:print:]]', '[X]','g') ;
regexp_replace
----------------
[X]
(1 row)
select REGEXP_REPLACE('ñino', '[^[:print:]]', '[X]','g') ;
regexp_replace
----------------
[X]ino
(1 row)
Why would Ҕ and ñ be caught in that?
Any guidance is appreciated.
\l
in psql)