Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't store Vector{UInt8} as expected in bytea #285

Open
nguiard opened this issue Oct 2, 2023 · 0 comments
Open

Can't store Vector{UInt8} as expected in bytea #285

nguiard opened this issue Oct 2, 2023 · 0 comments

Comments

@nguiard
Copy link

nguiard commented Oct 2, 2023

Hi,
I'm trying to store a Vector{UInt8} in a bytea column but am getting unexpected results. Maybe you have an idea of what I'm doing wrong or if this is a bug?

create database test;
create table data (
    id      int8    primary key generated always as identity,
    content bytea   not null
);
using LibPQ
c = LibPQ.Connection("dbname=test host=/var/run/postgresql")
tostore = Vector{UInt8}([1,2,3,4])
execute(c, "insert into data (content) values (\$1)", [tostore])

When doing select * from data;, I then expect the content column to print \x01020304, but it shows \x7b312c322c332c347d, and I'm a little bit lost as to why that happens...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant