-
Notifications
You must be signed in to change notification settings - Fork 342
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
missing escapes for bytea columns #52
Comments
Hi Thanks for the report. Do you have the same issue with BLOB ? |
Fixed for RAW datatype in commit 199a4b5, please use latest code from github. Normally BLOB should not have the same issue because they are not returned as HEX string. Let us know if you have any other problem with that. Regards, |
Hi, Best regards From: Darold [mailto:notifications@github.com] Hi Thanks for the report. Do you have the same issue with BLOB ? — |
Hi, BEGIN; COPY tt (c) FROM STDIN; COMMIT; But a second backslash is missing. I see \x but not \x select * from tt;
\xab42414646 |
Right, fixed in commit d4b1c8c |
It works now. Thank you. |
I had tested a table with a "raw" column.
SQL> create table tt (c raw(100));
Table created.
SQL> insert into tt (c) values (hextoraw ('ABBAFF'));
1 row created.
SQL> select dump(c), c from tt;
DUMP(C)
C
Typ=23 Len=3: 171,186,255
ABBAFF
The tool ora2pg results a table file and a copy file.
ora2pg -t TABLE -c x.conf -o TABLE.sql
-- Generated by Ora2Pg, the Oracle database Schema converter, version 11.4
SET client_encoding TO 'LATIN1';
\set ON_ERROR_STOP ON
CREATE TABLE tt (
c bytea
);
ora2pg -t COPY -c x.conf -o COPY.sql
-- Generated by Ora2Pg, the Oracle database Schema converter, version 11.4
SET client_encoding TO 'LATIN1';
\set ON_ERROR_STOP ON
TRUNCATE TABLE tt;
BEGIN;
COPY tt (c) FROM STDIN;
ABBAFF
.
COMMIT;
In the COPY statement I am missing the escapes of the binary output like this: \xABBAFF
If I import this without the escapes in a postgresql DB 9.x the result is a string "ABBAFF" and
not the hex bytes 0xAB 0xBA 0xFF.
select * from tt;
\x414242
With the escapes this works correct:
COPY tt (c) FROM STDIN;
\xABBAFF
.
select * from tt;
\xabbaff
(1 row)
The text was updated successfully, but these errors were encountered: