Zeos 7.1.3a x PostgreSql 8.1

The official tester's forum for ZeosLib 7.1. Ask for help, post proposals or solutions.
Post Reply
calico
Fresh Boarder
Fresh Boarder
Posts: 24
Joined: 03.10.2006, 15:48

Zeos 7.1.3a x PostgreSql 8.1

Post by calico »

Hello guys,

when adding fields in ZQuery(add fields) fields with a size of 2 are added with size 4, if 4 = 8 and 50(STRNG) = 200 (MEMO)... each by multiplying the original size of the field.
what is the problem?

Zeos 7.1.3a
PostGreSql 8.1.11 on Debian
DB Encoding - LATIN1
Delphi 7

Thank you for your attention.
Carlos.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: Zeos 7.1.3a x PostgreSql 8.1

Post by EgonHugeist »

Sure your encoding is LATIN1 and also the TZConnection.ClientCodePage? Do you open a UTF8-encoded connection?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
calico
Fresh Boarder
Fresh Boarder
Posts: 24
Joined: 03.10.2006, 15:48

Re: Zeos 7.1.3a x PostgreSql 8.1

Post by calico »

Hi EgonHugeist,

Config.
DB Encoding - LATIN1
controls_cp=CP_UTF16
TZConnection.ClientCodePage=LANTIN1

sql exemple
select
a.f1,
a.f2,
...,
cast((select f1 from table where cod = a.cod) as varchar(50)) as field_1 (returns field_1 type 'memo' with 200 positions, not string)
--50 is exactly size of field.
from a
if line write like cast((select f1 from table where cod = a.cod) as varchar(51)) as field_1 (returns field type 'string' but 200 positions not 51)

Tks.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: Zeos 7.1.3a x PostgreSql 8.1

Post by EgonHugeist »

calico wrote: cast((select f1 from table where cod = a.cod) as varchar(50)) as field_1 (returns field_1 type 'memo' with 200 positions, not string)
--50 is exactly size of field.
Bug of PostgreSQL see http://zeoslib.sourceforge.net/viewtopi ... 38&t=15798
calico wrote: if line write like cast((select f1 from table where cod = a.cod) as varchar(51)) as field_1 (returns field type 'string' but 200 positions not 51)
Sure about it??? Thought the results should be 'T(Wide)Memo' too!
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
calico
Fresh Boarder
Fresh Boarder
Posts: 24
Joined: 03.10.2006, 15:48

Re: Zeos 7.1.3a x PostgreSql 8.1

Post by calico »

I'm Sure.
This result should be TwideString (51) not TWideMemo or TWideString (200), do not know why it multiplies the size.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: Zeos 7.1.3a x PostgreSql 8.1

Post by EgonHugeist »

The results should be TWideMemo on my PG9.2 not TWideString. As my link describes: This is a bug of PostgreSQL not an issue we can handle correctly.

What i do NOT understand is why you get on second cast a TWideString(200) Field. My PG9.2 returns allways a varchar without a length -> TWideMemo.
No idea how to track that. Is it possible to have multiple instances of PG running?

Edit: Another suggestion..

It might be possible the older servers do reserver some bytes/character. UTF8 needs at least 4 bytes.
What happens if you add "CHARACTERSET LATIN1" to your varchar cast? This is just an idea, i've never tested. Don't know if it works or changes the current behavior..
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
calico
Fresh Boarder
Fresh Boarder
Posts: 24
Joined: 03.10.2006, 15:48

Re: Zeos 7.1.3a x PostgreSql 8.1

Post by calico »

Well, turned par with CAST to VARCHAR (size) and the field editor also put the correct size and it worked!
Tks all !
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: Zeos 7.1.3a x PostgreSql 8.1

Post by EgonHugeist »

What exacly was the solution? What have you done to get it running like you expect it?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
calico
Fresh Boarder
Fresh Boarder
Posts: 24
Joined: 03.10.2006, 15:48

Re: Zeos 7.1.3a x PostgreSql 8.1

Post by calico »

Select...
cast((select f1 from table where cod = a.cod) as varchar(51)) as field_1 (returs string, but size is wrong)
in fields editor on Delphi changed the size property to 51.
that was the solution at the time.

Tks.
Post Reply