Search found 5 matches

by bser
28.12.2010, 07:26
Forum: PostgreSQL
Topic: bytea field save\load
Replies: 10
Views: 4306

After a few days of codding I found what I need to do to save bytea-field data to disk correctly: - delphi 7 - using zeos version 7.0.0 alfa - pg version 9/0/2 - protocol:='postgresql-8'; - ADD files libpq.dll, libintl-8.dll, libiconv-2.dll to project exe-file (from PG bin directory) If I delete 3 P...
by bser
28.12.2010, 05:47
Forum: PostgreSQL
Topic: bytea field save\load
Replies: 10
Views: 4306

bser , What Zeos/postgres versions are you using? I'm using pg9 with Zeos 7 and it works fine to me. Zeos 6.6.6 stable pg 9.0.2 Here is an examle application (see attachment) I'm using. pg_file_in.txt - source file pg_file_myout.txt - file from pg bytea (hex encoded and without leading \) pg_db_tes...
by bser
27.12.2010, 11:53
Forum: PostgreSQL
Topic: bytea field save\load
Replies: 10
Views: 4306

Is there any example to save file to bytea field and to load it from into disk?
by bser
27.12.2010, 05:52
Forum: PostgreSQL
Topic: bytea field save\load
Replies: 10
Views: 4306

bser , дружище, тебе надо сперва грузить файл в поток, а потом загружать параметр из потока. Сори, не могу сейчас привести код, да он у меня на С++. Смотри в сторону ReadFromStream / SaveToStream I tried: fl_stream:=TFileStream.Create(fnm, fmCreate); try TBlobField(ZQuery1.Fields[0]).SaveToStream(f...
by bser
24.12.2010, 08:48
Forum: PostgreSQL
Topic: bytea field save\load
Replies: 10
Views: 4306

bytea field save\load

I have a table: CREATE TABLE blob_tmp ( id serial NOT NULL, b bytea CONSTRAINT blob_tmp_pk PRIMARY KEY (id) ) WITH ( OIDS=FALSE ); Then I save txt-file in it (this works fine; see source-file attachment): ZQuery1.Close; ZQuery1.SQL.Clear; ZQuery1.SQL.Add('insert into blob_tmp (id, b) values (nextval...