1

I am moving the database from postgres to postgres-xl. The client driver the erlang's epgsql:

The table schema is as follows:

CREATE TABLE test_table1 (id integer primary key, value text);

test data:

INSERT INTO test_table1 (id, value) VALUES (3001, '3001 number');

For sql query, The extended query protocol is used, parsing the sql command in the client side.

But the returned data is as follows:

 <<0,0,0,4,51,48,48,49,0,0,0,11,51,48,48,49,32,110,117,109,98,101,114>>

for integer 3001, The data is encoded as ascii coded by 51,48,48,49, it is not expected as <<0,0,0b,b9>>. How to control it by client-side parameter or by server-side parameter?

Chen Yu
  • 3,955
  • 1
  • 24
  • 51
  • I am no SQL expert but does it have anything to do with HOW you have defined the field in the db? – rvirding Mar 13 '15 at 14:05
  • I have read a little about the postgres-xl front-backend protocol, which is not same as postgres protocol. The protocol has 2 mode, simple mode and extended mode. For simple mode data always to be sent by text format. For extended mode, it combine 3 steps (parse, bind, execute), Only bind done, the data will be returned by binary format. I will make some experiment to make it more clear. – Chen Yu Mar 13 '15 at 21:02
  • 1
    The problem has been solved. The erlang's driver epgsql doesn't work well with postgres-xl. I have modified the epgsql's source code to solve the problem. – Chen Yu Mar 20 '15 at 01:15

0 Answers0