Error connecting to PostgreSQL

Error connecting to PostgreSQL

Postby nelson.cardoso » Thu 15 May 2014 18:52

Hi,
I have the following problem connecting to PostgreSQL

Conn.DriverName := 'DevartPostgreSQL';
Conn.GetDriverFunc := 'getSQLDriverPostgreSQL';
Conn.LibraryName := 'dbexppgsql.dll';
Conn.LoginPrompt := False;
Conn.VendorLib := 'not used';

Conn.Params.Clear;
Conn.Params.Add('DriverName=DevartPostgreSQL');
Conn.Params.Add('HostName=' + hostNameR.Text);
Conn.Params.Add('DataBase=' + dbNameR.Text);
Conn.Params.Add('User_name=' + userNameR.Text);
Conn.Params.Add('Password=' + passwordR.Text);
Conn.Params.Add('Server Port=' + portR.Text);
Conn.Params.Add('BlobSize=-1');
Conn.Params.Add('FetchAll=True');
Conn.Params.Add('LongStrings=True');
Conn.Params.Add('DetectParamTypes=True');
Conn.Open;

The following error occurs: SQL Server Error: Invalid value for parameter "cliente_encoding": "Win1252"

----------
follow my settings

Postgres version: 9.3
Driver Devart: latest version
Delphi 7
show client_encoding = WIN1252
show server_encoding = UTF8
database accessed: ENCODING = 'LATIN1'

Conn.Params.Add ('client_encoding = LATIN1'); Does not work????


*** Portuguese to English via google translator
nelson.cardoso
 
Posts: 5
Joined: Wed 14 May 2014 12:45

Re: Error connecting to PostgreSQL

Postby AlexP » Fri 16 May 2014 08:40

Hello,

We have already fixed a similar problem, and we can send you a night build in order for you to check this case on your sample. For this, please send your license number to alexp*devart*com.
AlexP
Devart Team
 
Posts: 5528
Joined: Tue 10 Aug 2010 11:35

Re: Error connecting to PostgreSQL

Postby lfgarrido » Wed 29 Oct 2014 19:29

Hello, I have the same issue too.

Delphi XE7 trial
Unidac 5.5.12 trial
Client Windows 8.1 64 bits
Server Debian 7 64 bits
PostgreSQL 9.2 64 bits
Database encoding = latin1
lc_collate = 'C'
lc_ctype ='C'
template = template0

When I try to connect shows:
SQL Server Error: Invalid value for parameter "cliente_encoding": "Win1252"
lfgarrido
 
Posts: 2
Joined: Wed 29 Oct 2014 19:24

Re: Error connecting to PostgreSQL

Postby azyk » Fri 31 Oct 2014 09:16

To solve the problem, in the connection properties, set the TUniConnection.SpecificOptions.Values['PostgreSQL.Charset'] option to 'LATIN1'. For example:
Code: Select all
  UniConnection.SpecificOptions.Values['PostgreSQL.Charset'] := 'LATIN1';
azyk
Devart Team
 
Posts: 961
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: Error connecting to PostgreSQL

Postby lfgarrido » Wed 12 Nov 2014 16:36

Hello, setting chartset to LATIN1 work, tks
lfgarrido
 
Posts: 2
Joined: Wed 29 Oct 2014 19:24

Re: Error connecting to PostgreSQL

Postby azyk » Fri 14 Nov 2014 06:22

It is good to see that the problem has been solved. Feel free to contact us if you have any further questions.
azyk
Devart Team
 
Posts: 961
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A


Return to dbExpress driver for PostgreSQL