You are not logged in.
Hi!
we have small problem for TSQLDBZEOSConnectionProperties:
Props := TSQLDBZEOSConnectionProperties.Create(Format('postgresql://%s:%s',[eHost.Text,ePort.Text]), eDBName.Text, eUser.Text, ePasswd.Text);
Prop.GetFieldDefinitions('testtable',Fields,true);
WriteLn(RawUTF8ArrayToCSV(Fields,#13#10' '));
for table like this (I use db first approach)
CREATE TABLE testtable
(
id next_num_global_id NOT NULL,
test character varying(20) NOT NULL
will print:
id [int8 8 0 0] *
test [varchar 80 0 0] *
best regards,
Maciej Izak
Offline
So you receive ColumnLength=80 whereas you expect 20?
I do not know where the error comes from (TSQLDBConnectionProperties.SQLGetField sounds correct), but I guess this is not an issue.
With a PostgreSQL database, you may just ignore the text field length, and consider it without any field limit...
See https://www.postgresql.org/docs/9.3/sta … acter.html
Offline
So you receive ColumnLength=80 whereas you expect 20?
yes
I do not know where the error comes from (TSQLDBConnectionProperties.SQLGetField sounds correct), but I guess this is not an issue.
With a PostgreSQL database, you may just ignore the text field length, and consider it without any field limit...
See https://www.postgresql.org/docs/9.3/sta … acter.html
For ODBC (checked in our SynDBExplorer for the same DB) the value of ColumnLength is correct (20). Maybe Zeos bug?
Last edited by hnb (2016-06-08 13:09:38)
best regards,
Maciej Izak
Offline
My test result for Zeos without mORMot is also depressive:
WriteLn(ZReadOnlyQuery1.FieldDefs[i].Size); // 80
WriteLn(ZReadOnlyQuery1.FieldDefs[i].Precision); // 80
while ODBC + TSQLDBConnectionProperties + PostgreSQL is ok.
maybe for Zeos somehow is returned maximum possible count of bytes for UTF8 string:
https://www.postgresql.org/docs/current … ibyte.html
Last edited by hnb (2016-06-08 13:26:40)
best regards,
Maciej Izak
Offline
Which ZEOS?
At my ZEOS 7.2 and 7.3 (current) seems to be correctly.
Michal
Offline
@ab, @miab3
thanks for the answers. It was problem on my machine + probably old trunk ZEOS 7.2, anyway now all works as expected.
best regards,
Maciej Izak
Offline