pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedinsert bytea data manually
2+ messages / 2 participants
[nested] [flat]
* insert bytea data manually
@ 2005-10-03 21:10 Muhlis Akdag <mican58@gmail.com>
2005-10-03 23:01 ` Re: insert bytea data manually Kris Jurka <books@ejurka.com>
0 siblings, 1 reply; 2+ messages in thread
From: Muhlis Akdag @ 2005-10-03 21:10 UTC (permalink / raw)
To: pgsql-jdbc
Hi,
I have a question about bytea columns. I want manually select the
column.. this looks like this..when I export it from pgadmin into a csv
file..
"10";"PK\003\004\024\000\000\000\000\000\214\22453\341\24519\036\000\000\000\03.........."
so how I can inert it back to the database manually.. like this..
insert into files (docid,file) values
(1,'PK\003\004\024\000\000\000\000\000\214\22453\341\24519\036\000\000\000\03..........")
but it brings error when i try this..?
can sombody help me how i can extract bytea data and insert it back
manually with SQL commands?
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: insert bytea data manually
2005-10-03 21:10 insert bytea data manually Muhlis Akdag <mican58@gmail.com>
@ 2005-10-03 23:01 ` Kris Jurka <books@ejurka.com>
0 siblings, 0 replies; 2+ messages in thread
From: Kris Jurka @ 2005-10-03 23:01 UTC (permalink / raw)
To: Muhlis Akdag <mican58@gmail.com>; +Cc: pgsql-jdbc
On Mon, 3 Oct 2005, Muhlis Akdag wrote:
> I have a question about bytea columns. I want manually select the column..
> this looks like this..when I export it from pgadmin into a csv file..
> "10";"PK\003\004\024\000\000\000\000\000\214\22453\341\24519\036\000\000\000\03.........."
>
> so how I can inert it back to the database manually.. like this..
>
> insert into files (docid,file) values
> (1,'PK\003\004\024\000\000\000\000\000\214\22453\341\24519\036\000\000\000\03..........")
>
See the documentation for the correct escapting you will need.
http://www.postgresql.org/docs/8.0/static/datatype-binary.html
You need to double the backslashes when sending the data to the backend.
Kris Jurka
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-10-03 23:01 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-10-03 21:10 insert bytea data manually Muhlis Akdag <mican58@gmail.com>
2005-10-03 23:01 ` Kris Jurka <books@ejurka.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox