In a PostgreSQL table I have a column file_bytes
which has the data type bytea.
I am looking for a simple SQL statement to manipulate only the last byte of the content of this column.
In a PostgreSQL table I have a column file_bytes
which has the data type bytea.
I am looking for a simple SQL statement to manipulate only the last byte of the content of this column.
Copyright © 2021 Jogjafile Inc.
demo: db<>fiddle
https://www.postgresql.org/docs/current/static/functions-binarystring.html
octet_length()
gives the number of bytes of binary data.overlay()
allows to rewrite data from a certain position.