Page 1 of 1

[patch_done] PostgreSQL, problems with BLOB Data

Posted: 14.04.2012, 21:59
by mmvisual
Hello,

I have no Install the newest PostgreSQL Server "postgresql-9.1.3-1-windows.exe" and install Lazarus "Lazarus-1.1-36568-fpc-2.6.0-20120405-win32.exe" and the Zeos Trunc from today.

I can create a new Database, the tables and import the data into the new database. All rows with text are inside, but the BLOB field is corrupt.

I import this data from a SQLite table. When I connect the SQLite table to my EXE, then I see all pictures, but not with PostgreSQL.

With Zeos 6.6.6 have it works fine.

This Error write my EXE into the Log:
"22:56:52 E: Unbekanntes Bildformat"
(Unknown picture format)

If you need more information, then I can help.

Best Regards, Markus.

Posted: 15.04.2012, 14:16
by EgonHugeist
Hallo Markus,

as far as i know did the Bytea behavior changed since v9. PG8 delivers a hexstring and PG9 delivers a hexString with a starting 'x'A1...! So please download http://zeos.firmos.at/viewtopic.php?t=3427 or the testing-branch...

Everything ok?

Best regards,
Michael

Posted: 15.04.2012, 16:04
by mmvisual
Hello Michael,

I have install your "testing-egonhugeist" and there comes this message:

16:58:14 Error: Cannot open database! Out of memory (DB-Connect)

And I cannot open a table.

Yes, all is OK. I have think, I test the new V7 with my EXE and Lazarus. I need the SQLite, MySQL and PostgreSQL. Now, the first two are working good.

Thank you very much for developing the Zeos component!

Best regards Markus.

Posted: 15.04.2012, 16:11
by mmvisual
PS: Here the SQL code for the created table. The blobfield is from type "bytea" an there are PNG or JPG images saved with maximum size from 64KB.

Code: Select all

CREATE TABLE foto
(
  id serial NOT NULL,
  id_id integer,
  bezeichnung character varying(100),
  tabelle character varying(30),
  bildtyp character varying(10) NOT NULL,
  bild bytea,
  bilddatei character varying(255),
  aenddatum timestamp without time zone NOT NULL DEFAULT '2012-04-14 22:27:10.345'::timestamp without time zone
)
WITH (
  OIDS=FALSE
);
ALTER TABLE foto
  OWNER TO postgres;

Posted: 15.04.2012, 19:44
by EgonHugeist
Patch done Rev 1157.

Danke Markus.

Posted: 16.04.2012, 20:17
by mmvisual
If in the StringFields are a '\', the displayed string was not right. It is now corrected in:
https://zeoslib.svn.sourceforge.net/svn ... gonhugeist
Rev 1159

@EgonHugeist
Thank you for nice support!