Page 1 of 1

Issue with TEXT type

Posted: Fri 22 Oct 2010 07:20
by user8
Hello Devart Team,

We are experiencing an issue using PgDac 2.0 with Delphi XE.

We have a postgresql database that includes a table with a TEXT field.

We set this field using a PgTable ...

Code: Select all

 
MyTable.FieldByName('MyTEXTField').AsString := 'Hello word' 
But then in the database we can read 'Hello wor'
The last character is missing.

The behaviour seems to be different with Varchar and TEXT types ?
Before we used PgDac 1.20.0.19 with Delphi 2010 and it worked with the TEXT type.

Best regards

Posted: Fri 22 Oct 2010 07:32
by user8
The Postgres version is 8.4.4

Posted: Fri 22 Oct 2010 10:06
by AlexP
Hello,

I could not reproduce the problem.
I have created a table like

CREATE TABLE test
(
text_field text
)
WITH (OIDS=FALSE);
ALTER TABLE test OWNER TO postgres;

and inserted a value like

PgTable1.Open;
PgTable1.Append;
PgTable1.FieldByName('text_field').AsString:= 'Hello word';
PgTable1.Post;

and in PgAdmin I can see the correct value.

I have tested it with Delphi XE, PgDAC 2.00.0.1, PostgresSQL 8.4.1 and 9.0.

Please send a script to create the table.

Posted: Mon 25 Oct 2010 07:20
by user8
Hello AlexP and thank you for your reactivity.

I made some investigation. I created the same table as you. I created a small test application that just inserts value like you :

Code: Select all

  PgTable1.Open;
  PgTable1.Append;
  PgTable1.FieldByName('text_field').AsString:= Edit1.text;
  PgTable1.Post;
I can reproduce the bug only if UseUnicode is checked in the options of TPgConnection and indeed, in my main application, this option is checked since I manage unicode strings in the application and also in the database.

Did you check this option?

Best regards,

Posted: Mon 25 Oct 2010 09:51
by AlexP
Hello,

We have reproduced the problem.
But it arises only in Delphi XE, in other Delphi versions the values are inserted correctly even with the UseUnicode option enabled.
We will notify you as soon as we have any results.

Posted: Mon 25 Oct 2010 11:39
by user8
OK, thank you.

Posted: Tue 26 Oct 2010 07:34
by AlexP
Hello,

This problem is connected with the fact that the UnicodeToUtf8 procedure was modified in XE for the cross-platform development sake.
(https://forums.embarcadero.com/message. ... eID=276790).
We fixed it, this fix will be included in the next build of PgDAC.