How to get one byte char from byte in postgresql query?

I interested in how to write char in query by the unicode index or byte format(0x27)

So want to get something like that

COPY test_table FROM '/tmp/tests/test.csv' WITH DELIMITER '0x27' CSV

The real need is to insert CSV into postgres with unprintable delimiter

But if it is not possible to use unprintable symbols in COPY... query, i would like to know anyway is it possible to write char by byte difinition, like in example or near that?

Yea, i read documentation, but didint find any examples, and i was searching for answer in many places

Upvotes: 1

Views: 793

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 246493

You can specify any character using extended string literals and UNICODE escapes:

... DELIMITER E'\u001B'

See the documentation for details.

Upvotes: 1

Related Questions