TatukGIS menu

Q&A - Question

Postgres c# .Net libpg.dll

Question
EltS asked on May 23, 2019, keyword: Developer Kernel
Hi,

I am trying to open a TGIS_LayerSqlPgisLibpq() layer class using a ttkls file, like this:

[TatukGIS Layer]
Storage=PostGIS
Layer=v_pontosc_gismig
Dialect=POSTGRESQL
Libpq=host=localhost port=5432 dbname=postgres user=postgres password=usetudo client_encoding=WIN1250
RowsetSize=2000
GeometryFieldCast=Native
GeometryColumn=geom
IndexColumn=oid

But I had this error:

Additional information: 0030 Error during mapping file "libpq.dll

%1 não é um aplicativo Win32 válido (errno 193)" (code 0)

I know the libpq.dll is a C++ library and I can not reference this in my solution and just copying that to bin folder do not solve. 

Is someone knows how to solve this?
Answers
Artur Redzko (TatukGIS) replied March 22, 2018
Libpq library files are a part of Postgres installation should be in your system and the application should see them. Otherwise you should copy dlls :

- libpq.dll
- ssleay32.dll
- libintl-8.dll
- libiconv-2.dll
- libeay32.dll

into your bin folder (or x86 and x64 subfolders) and make sure that the libpq version and supported platform matches your application.
EltS replied March 22, 2018
Thank you about the reply,

Yes. All those library files I have been copied from postgres installation folder. I put them in my bin folder and it still does not work.

I have tested postgres using the devart provider to connect TGIS_LayerSqlPgisAdoNet() layer and the performance was very slow.

I would like to test using the native libpq.dll in my .Net solution because on TatukGis Viewer (copying those dll's to tatukgis installation folder works), the render performance was very good. Very fast at all.

Is there someting that I am forgetting?
Artur Redzko (TatukGIS) replied March 22, 2018
Please send us on support@tatukgis.com a test application with your config and we will check what is wrong. Did you try to change Platform target (x86, x64) in build options?
AKNLEO replied May 23, 2019
Hello,
I tried this but it does not work.
The dll are in exe directory.
[TatukGIS Layer]
  Storage=PostGIS
  Layer=parcel;public
  Dialect=POSTGRESQL
  Libpq=host=192.168.70.51 port=5432 dbname=rfu user=postgres password=pgrfu 
  client_encoding=WIN1250
  GeometryFieldCast=Native
  GeometryColumn=geom
  IndexColumn=SPC
Artur Redzko (TatukGIS) replied May 23, 2019
Again, please send us on support@tatukgis.com a test application with your config and dlls. If the error message "%1 não é um aplicativo Win32 válido (errno 193)" (code 0)" repeats, then you use wrong dlls (different platform).
If you would like to answer the question please Sign In.
*
*
Please review our recent Privacy Policy.
If you have any questions or requests, please contact us.
Rules
The Questions and Answers (Q & A) is intended to provide a means of communication between TatukGIS customers.
 
  1. Licensed users (with active maintenance play) of TatukGIS products may contribute to the Q & A content. Read-only access is available to anyone.
  2. Keep the content positive and professional.
  3. Be courteous to others by posting information when a question or issue asked on the Q & A is answered or resolved by other means (such as with help from TatukGIS technical support). Offer others at least a hint how the posted question was answered or the issue was resolved.
  4. The Q & A is not a replacement for TatukGIS technical support. TatukGIS team may or may not regularly follow or contribute content.