Mark Williams 14 Posted May 15, 2019 I am using Array DML to post data to a postgres table. One of the fields is of type bytea. I have tried setting the datatype for the relevant query parameter toftBlob. This fails with the error: Quote [FireDAC][Phys][PG]-352. Object value for [PAGES] parameter of [ftBlob] type is not supported I have tried setting the datatype for the query parameter to the same TFieldType as the field in the FireDAC dataset. I get the same error, so it would seem the field is a blob field. Code below: Query2,Params[3].DataType:=ftBlob; Query2Params[3].AsStream:=CreateBlobStream(Fields[ages], bmRead); Share this post Link to post
jobo 1 Posted May 16, 2019 Could you please add column definition from this table (ddl) and the query statement? Share this post Link to post
Mark Williams 14 Posted May 16, 2019 The column definition is ALTER TABLE public.bundles Add COLUMN pages bytea; The query statement INSERT INTO bundles (pages) VALUES(:P) Share this post Link to post
jobo 1 Posted May 21, 2019 bytea is not standard blob, more like a string, encoded to cover every case of special chars or nulls. There are large objects in pg, but this type has even less support. try using ftStream instead of ftBlob Look up some special flags for pg blob connection in Emba docs. If your data is "close to text" which could be the case reading "pages", you also might try another column type like text or even json/jsonb. Share this post Link to post
Mark Williams 14 Posted May 21, 2019 Thanks for the info. I gave up on byteA in the end. The data is an array of numbers. I now save it to csv and in a text field and then restore it to an array when needed. There does not seem to be any appreciable loss of speed. Would have certainly looked at ftStream otherwise. Share this post Link to post