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
Error connecting to PostgreSQL
Re: Error connecting to PostgreSQL
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.
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.
Re: Error connecting to PostgreSQL
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"
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"
Re: Error connecting to PostgreSQL
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';
Re: Error connecting to PostgreSQL
Hello, setting chartset to LATIN1 work, tks
Re: Error connecting to PostgreSQL
It is good to see that the problem has been solved. Feel free to contact us if you have any further questions.