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.
Zeos 7.1.3a x PostgreSql 8.1
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: Zeos 7.1.3a x PostgreSql 8.1
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/
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/
Re: Zeos 7.1.3a x PostgreSql 8.1
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.
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.
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: Zeos 7.1.3a x PostgreSql 8.1
Bug of PostgreSQL see http://zeoslib.sourceforge.net/viewtopi ... 38&t=15798calico 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.
Sure about it??? Thought the results should be 'T(Wide)Memo' too!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)
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/
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/
Re: Zeos 7.1.3a x PostgreSql 8.1
I'm Sure.
This result should be TwideString (51) not TWideMemo or TWideString (200), do not know why it multiplies the size.
This result should be TwideString (51) not TWideMemo or TWideString (200), do not know why it multiplies the size.
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: Zeos 7.1.3a x PostgreSql 8.1
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..
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/
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/
Re: Zeos 7.1.3a x PostgreSql 8.1
Well, turned par with CAST to VARCHAR (size) and the field editor also put the correct size and it worked!
Tks all !
Tks all !
- EgonHugeist
- Zeos Project Manager
- Posts: 1936
- Joined: 31.03.2011, 22:38
Re: Zeos 7.1.3a x PostgreSql 8.1
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/
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/
Re: Zeos 7.1.3a x PostgreSql 8.1
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.
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.