How can I switch from TEXT to BINARY frontend protocol?

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
elid
Posts: 5
Joined: Sun 24 Jan 2010 17:09

How can I switch from TEXT to BINARY frontend protocol?

Post by elid » Wed 03 Feb 2010 17:57

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

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Thu 04 Feb 2010 10:53

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;

Post Reply