"Tsunakawa, Takayuki" <tsunakawa.takay@xxxxxxxxxxxxxx> writes: > It is embarrassing to ask such a thing, but is there any way to sort character column values in EBCDIC order inside the PostgreSQL server? i.e. is it possible to use EBCDIC collation in PostgreSQL, say, by using ICU or something? We need to run on a certain mainframe. > I see almost no hope from the following, but let me make sure. > https://www.postgresql.org/message-id/flat/28548.1424884373%40sss.pgh.pa.us#28548.1424884373@xxxxxxxxxxxxx > "Hmm ... EBCDIC ... is that mandatory? Because there are a pretty large > number of ASCII dependencies in PG, mostly arising from our support of > multibyte character sets, which are all expected to be ASCII supersets. > If there's not a way to run the server process in ASCII-land, you're > likely dead in the water. I would not want to try to ferret out all > the dependencies." As I recall, that question was about converting the server to use EBCDIC strings everywhere. That seems impractical for the reasons I mentioned. But you could probably sort according to EBCDIC order if you were willing to accept some inefficiency: internal to the comparison function, convert each string to EBCDIC on each call. Another way you could imagine is to store EBCDIC strings embedded in bytea values. regards, tom lane