Page 1 of 1

How can I switch from TEXT to BINARY frontend protocol?

Posted: Wed 03 Feb 2010 17:57
by elid
Currently we work with the DevArt dotConnect to use a TEXT frontend protocol to interact with the PostresSql DB.

We read in the dotConnect spec that the dotConnect can work use binary protocol
to work faster.

How can I switch from TEXT to BINARY frontend protocol and vice versa?


thanks,

Eli

Posted: Thu 04 Feb 2010 10:53
by StanislavK
Probably you mean the Mode property of the PgSqlLoader class. PgSqlLoader is used to load multiple rows into a table, and it can operate in text or binary mode. The binary mode is faster; you can set it in the Mode property of your PgSqlLoader object:

Code: Select all

pgSqlLoader1.Mode = PgSqlLoaderMode.Binary;
Please note that the Binary mode is available for PostgreSQL protocol 3.0 only. PostgreSQL servers from 7.4 and higher use it as default, but you may explicitly set it for your connection:

Code: Select all

PgSqlConnectionStringBuilder sb = new PgSqlConnectionStringBuilder(pgSqlConnection1.ConnectionString);
sb.Protocol = ProtocolVersion.Ver30;
pgSqlConnection1.ConnectionString = sb.ConnectionString;